Profile Picture

auto scale on real time graph

Posted By Daniel Csimszi 11 Years Ago
Author
Message
Daniel Csimszi
Posted 11 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 61, Visits: 35
Hi,

I am trying to auto scale my graph during run time. I have two options ether the user can give min and max values of the Y axes or it should be done automatic. I have this code:

public void setAutoscale(int axisIndex, bool autoscale)
{
if (autoscale)
{
m_Chart.Axis(axisList[axisIndex].AxisId).View = new NContentAxisView();
}
else
{
m_Chart.Axis(axisList[axisIndex].AxisId).View = new NRangeAxisView(new NRange1DD(1000, 3000));
}
}

The only problem of mine is that I would like to set a minimum value of the automatic scale set like that:

m_Chart.Axis(axisList[axisIndex].AxisId).View = new NContentAxisView(0);

Is it possible to sort this out somehow (any built in method?)? I know I could write my own function to check the maximum value in every tick, but that seems a bit useless, of course if there are not any other option I will need to go with that.

Thank you for your help in advanced
Daniel


Nevron Support
Posted 11 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: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Daniel,

You can specify a range view where only the min or max value is regarded - for example:

chart.Axis(StandardAxis.PrimaryY).View = new NRangeAxisView(new NRange1DD(80, 0), true, false);

tells the y axis to always start from 80 and extend to whatever value is in the data.



Best Regards,
Nevron Support Team



Daniel Csimszi
Posted 11 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 61, Visits: 35
Hi,

Thank you, that's working perfectly! There is just one more question about that: is it possible to make the maximum value to round up?

Regards
Daniel



Similar Topics


Reading This Topic