How to set min and max y-axis and tick values


Author
Message
jerry tovar
jerry tovar
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 2, Visits: 5
I have a nevron chart that shows percentages, 0% to 100+%.

I want the y-Axis to display a range of min=0% to max=110%. But when I run my code, the chart displays fine, but the y-Axis values or ticks are (0%, 50%, 100%). The 110% label or tick does not display.

How can I force the y-Axis labels or ticks to display a minimum of 0% and a max of 110%?

Here is my code:
Snippet
var yAxis = chart.Axis(StandardAxis.PrimaryY);SnippetyAxis.View = new NRangeAxisView(new NRange1DD(.0, 1.10), true, true);Snippetvar scale = (NLinearScaleConfigurator)yAxis.ScaleConfigurator;Snippetscale.LabelValueFormatter = new NNumericValueFormatter("P0");Snippetscale.RoundToTickMax = false;Snippetscale.RoundToTickMin = false;



Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi,
The problem in this case is that the control still uses automatic tick calculation - in this case the algorithm has simply selected a step of 50 based on the default preferences for tick density. Obviously you cannot have a tick mark at 110 when the step is 50. You can work around this in two ways:
1. Specify custom major tick step - for example:

scale.MajorTickMode = MajorTickMode.CustomStep;
scale.CustomStep = 0.1;

2. Use custom ticks:
scale.MajorTickMode = MajorTickMode.CustomTicks;
scale.CustomMajorTicks.Add(0);
scale.CustomMajorTicks.Add(0.5);
scale.CustomMajorTicks.Add(1.0);
scale.CustomMajorTicks.Add(1.1);

Hope this helps - let us know if you meet any problems or have any questions.


Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search