Nevron Forum

AxisY's zero align issue

https://www.nevron.com/Forum/Topic3223.aspx

By inhyuk son - Wednesday, March 10, 2010

I want the labels on Y-axis to be start from zero.
What should I do?
By Michael Hayford - Wednesday, March 10, 2010

Here's what I've done to get the zero included on the axis:

' use a range axis view to set the actual range of values you want displayed.
chart.Axis(StandardAxis.PrimaryY).View = New NRangeAxisView(New NRange1DD(0, yMax))

' use a scale configurator to turn off the tick rounding at the axis minimum
Dim valueScale As NLinearScaleConfigurator = New NLinearScaleConfigurator()
valueScale.RoundToTickMin = False
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = valueScale

This has worked for me. I'd be happy to know if there is a "better" way.

Regards

Mike

By Blagovest Milanov 1 - Thursday, March 11, 2010

Hi Michael, Hi Inhyuk,

Yes that's the right way to do it - you can consider setting a NRangeAxisView without a max value restriction:

chart.Axis(StandardAxis.PrimaryY).View = New NRangeAxisView(New NRange1DD(0, 0), True, False)

that way you'll not have to calculate Y max and let the control do it.

Best regards,
Bob

 

 

By Blagovest Milanov 1 - Wednesday, March 24, 2010

Hi Mike,

Just a short note to take a look at the PrimaryY Axis & SecondaryY Axis zero align issue topic in the forum - it shows a complete implementation that handles all the cases...

Best regards,
Bob