Solved

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

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

21 Experts available now in Live!

Get 1:1 Help Now