Solved

How do I change force the Y axis Maximum in a Visual Studio Chart

Posted on 2016-11-16
5
53 Views
Last Modified: 2016-11-23
I am plotting data a line on a chart.  I want the Y axis range to stay the same.  The code is below data is changing and so the chart is constantly updating.    How can I fix the Y axis range?

    Chart1.Series.Clear()
    Chart1.Series.Add("Plot")
    Chart1.Series("Plot").ChartType = DataVisualization.Charting.SeriesChartType.FastLine
     For i = 0 To 200
                       Chart1.Series("Plot").Points.AddXY(i, theData.GetValue(i))
     Next (i)
0
Comment
Question by:Tom_Hickerson
  • 3
  • 2
5 Comments
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41890973
try add something like this?
Chart1.ChartAreas(0).AxisY.Maximum = 200
        Chart1.ChartAreas(0).AxisY.Minimum = 10

Open in new window

0
 
LVL 1

Author Closing Comment

by:Tom_Hickerson
ID: 41895926
That worked thanks.  I was playing with the chart areas, but never found that one.  How do you find these values to change?  Is there a help file or website?
0
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 41898480
well, I think the best resources would be MSDN?

Chart Class
https://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.chart(v=vs.110).aspx

try to browse through the left hand side sub links.

for more examples you may do an Internet search instead. hope that helps
0
 
LVL 1

Author Comment

by:Tom_Hickerson
ID: 41899665
I saw that, but I don't see any reference to the specific axisy.minimum.
0
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 41900011
got to know the knowledge base is quite huge in MSDN.

first, on the left hand side sub links, i go click the ChartArea class then click ChartArea Properties
after that, i click on AxisY property


which lead you to:

Axis Class
https://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.axis(v=vs.110).aspx

Finally look for the Minimum property there.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question