Solved

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

Posted on 2016-11-16
5
31 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 49

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 49

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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

864 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now