Profile Picture

determinating min max values for a surface chart

Posted By Rolf Sooss 14 Years Ago
Author
Message
Milen Metodiev
Posted 14 Years Ago
View Quick Profile
Forum Member

Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)

Group: Nevron Team
Last Active: 14 Years Ago
Posts: 48, Visits: 1

Hi Rolf,

The chart calculates the min and max values before it is rendered. The NAxis.SeriesRange property gives access to the calculated min and max for all series that are scaled on a given axis. You can use this property either in the OnBeforePaing method of the chart paint callback (1), or after you explicitly invoke chart calculation (2):

(1)

chart.PaintCallback = paintCallback;

public class MyPaintCallback : INPaintCallback
{
     public void OnBeforePaint(NPanel panel, NPanelPaintEventArgs eventArgs)
     {
         NChart chart = nChartControl1.Charts[0];
         NAxis axisY = chart.Axis(StandardAxis.PrimaryY);
         NRange1DD range = axisY.SeriesRange;
     }

     ...
}

(2)

nChartControl1.Document.Calculate();
nChartControl1.Document.RecalcLayout(nChartControl1.View.Context);
NAxis axisY = chart.Axis(StandardAxis.PrimaryY);
NRange1DD range = axisY.SeriesRange;

 

You can also calculate the min max values manually from the series data, there is no need to execute db queries again.

I hope this helps,

Best Regards,
Milen



Rolf Sooss
questionmark Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 5, Visits: 1
I have a chart with multiple surfaces and made a little data manipulation tab so i can change the look of each surface. since the data for each surface can be manipulated (data base is a access DB and the surface data is generated through queries) getting the min max values from the db is taking to long. I want to display the min/max values for the "Altitude" (primary Y axis) and manipulate the color range according to the min/ max values. The color range manipulation is already implemented, but i don´t want to run through the query again just to get min max values. Can they be determined from the existing surface data?



Similar Topics


Reading This Topic