Solved

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

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

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 50

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 50

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

774 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