Profile Picture

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

Posted By jerry tovar 10 Years Ago
Author
Message
jerry tovar
Question Posted 10 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 9 Years Ago
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
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
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





Similar Topics


Reading This Topic