Hi Jason,
You need to install a custom paint call back as the actual axis range is computed at layout phase, before the component is painted. This is because the range may be affected by the size of the control on the screen/printer due to tick rounding and automatic tick step generation - the following code snippet shows how to get the actual range shown on the Y axis:
class NCustomPaintCallback : INPaintCallback
{
#region INPaintCallback Members
public void OnAfterPaint(NPanel panel, NPanelPaintEventArgs eventArgs)
{
NChart chart = (NChart)panel;
NRange1DD rulerRange = chart.Axis(StandardAxis.PrimaryY).Scale.RulerRange;
// rulerRange.Begin contains scale begin after tick rounding
// rulerRange.End contains scale begin after tick rounding
}
public void OnBeforePaint(NPanel panel, NPanelPaintEventArgs eventArgs)
{
}
#endregion
}
private void Form1_Load(object sender, EventArgs e)
{
NChart chart = nChartControl1.Charts[0];
chart.PaintCallback = new NCustomPaintCallback();
NBarSeries bar1 = (NBarSeries)chart.Series.Add(SeriesType.Bar);
bar1.Values.Add(10);
bar1.Values.Add(23);
bar1.Values.Add(13);
}
Hope this helps - let me know if you meet any problems or have any questions.
Best regards,
Bob