Profile Picture

how to make X and Y axis take same range and intervals

Posted By Annamalai Muthiah 13 Years Ago
Author
Message
Nevron Support
Posted 13 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 following code shows how to recalculate the chart and get the axis range based on the current data:

NChart chart = nChartControl1.Charts[0];
NBarSeries bar = new NBarSeries();

bar.Values.Add(10);
bar.Values.Add(20);
bar.Values.Add(30);
chart.Series.Add(bar);
nChartControl1.Document.Calculate();

nChartControl1.Document.RecalcLayout(nChartControl1.View.Context);
NRange1DD axisRange = chart.Axis(StandardAxis.PrimaryY).Scale.RulerRange;

Hope this helps...



Best Regards,
Nevron Support Team



Annamalai Muthiah
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 1, Visits: 1
I have two axes (X and Y) and one line series plotted with respect to those axes, now how can I make both X and Y axes have the same minimum, maximum and intervals?. For example, consider while plotting a line series your code returns a range [0-1000] for X-Axis [Say major tick mark interval = 100] and a Range [0-700] for Y-Axis [Say major tick mark interval = 50] . But before plotting your default range I want to write a code which picks up the maximum range (in this case [0-1000]) at run time and plot both X and Y axis with that same range and same interval (say 50 or 100 but both axis should have the same).
PS: I know how to explicitly set the values of a range. But without hardcoding I am looking on how make both axis lookalike given any data set.



Similar Topics


Reading This Topic