Profile Picture

AxisY's zero align issue

Posted By inhyuk son 14 Years Ago
Author
Message
inhyuk son
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

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?

Attachments
1.PNG (47 views, 23.00 KB)
Michael Hayford
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)

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



bob milanov
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

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

 

 



bob milanov
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

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





Similar Topics


Reading This Topic