Answered by:
Set Interval on Chart

Hi,
Each value on my Line Chart is between 90 and 100. However, the YAxis starts at 0 and ends at 100 in increments of 10. So the line looks almost straight.
I want it to go 90100 in increments of 1.
How do I do this? Thanks.
<asp:Chart ID="Chart1" runat="server"> <series> <asp:Series Font="Verdana, 10px" Name="Series1" XValueMember="Day" YValueMembers="Result" IsValueShownAsLabel="True" YValuesPerPoint="4" CustomProperties="DrawingStyle=Cylinder" ChartType="FastLine"> </asp:Series> </series> <chartareas> <asp:ChartArea Name="ChartArea1"> <AxisY IsLabelAutoFit="False" IntervalAutoMode="VariableCount"> </AxisY> <AxisX Interval="1" LineColor="DarkBlue" IsLabelAutoFit="False"> </AxisX> </asp:ChartArea> </chartareas> </asp:Chart>
Question
Answers

you can try something like this, if you don't know the values beforehand.
I add/subtract 5 so the high and low values are not at the top/bottom
Chart1.ChartAreas(0).AxisY.Minimum = Chart1.Series(0).Points.FindMinByValue("Y1", 0).YValues(0)  5 Chart1.ChartAreas(0).AxisY.Maximum = Chart1.Series(0).Points.FindMaxByValue("Y1", 0).YValues(0) + 5
 Marked as answer by obrienkev Wednesday, January 06, 2010 3:52 PM
All replies



you can try something like this, if you don't know the values beforehand.
I add/subtract 5 so the high and low values are not at the top/bottom
Chart1.ChartAreas(0).AxisY.Minimum = Chart1.Series(0).Points.FindMinByValue("Y1", 0).YValues(0)  5 Chart1.ChartAreas(0).AxisY.Maximum = Chart1.Series(0).Points.FindMaxByValue("Y1", 0).YValues(0) + 5
 Marked as answer by obrienkev Wednesday, January 06, 2010 3:52 PM

you can try something like this, if you don't know the values beforehand.
I add/subtract 5 so the high and low values are not at the top/bottom
Chart1.ChartAreas(0).AxisY.Minimum = Chart1.Series(0).Points.FindMinByValue("Y1", 0).YValues(0)  5 Chart1.ChartAreas(0).AxisY.Maximum = Chart1.Series(0).Points.FindMaxByValue("Y1", 0).YValues(0) + 5
Thanks!! That actually does work.