Group: Forum Members
Last Active: 12 Years Ago
Posts: 21,
Visits: 1
|
I want the labels on Y-axis to be start from zero. What should I do?
1.PNG
(47 views,
23.00 KB)
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 14,
Visits: 1
|
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
|
Group: Forum Members
Last Active: 6 Months Ago
Posts: 153,
Visits: 11
|
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
|
Group: Forum Members
Last Active: 6 Months Ago
Posts: 153,
Visits: 11
|
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
|