Hi I currently do need to get two things for which I currently have no clue how to get it.
I’m using FastLineRenderableSeries and XyDataSeries<double,double> in SciChart 2D.
1st: The absolute min and max values from an curve.
What I found is that I can get the YMax/YMin and XMax/XMin, but that is not what I need.
-> I need to get the “Point” (x, and y value) where the maximum/minimum is.
2nd: I Need the X-value of an Y-Value (or the list of x-values if the y-value does exist more than once).
Lets say I have the y-Value “5” and want to know at which x-value this is.
Is there a fast and elegant way to get this information from existing RenderableSeries via the SciChart API, or Do I need to get this information from my data source before appending the curves?
Thanks,
Ben
- Bernd Held asked 6 years ago
- You must login to post comments
Hi Bernd
It’s as simple as
double yMax = double.MinValue;
int indexMax = -1;
IList<double> yValues = DataSeries.YValues as IList<double>
for(int i = 0; i < DataSeries.Count; i++)
{
double yCurrent = yValues[i];
if (yCurrent > yMax)
{
yMax = yCurrent;
indexMax = i;
}
}
double xMax = (double)DataSeries.XValues[indexMax];
Best regards,
Andrew
- Andrew Burnett-Thompson answered 6 years ago
- Thanks Andrew. I had a different complicated idea at first, but this is a good solution for me. Best regards, Ben
- You must login to post comments
Please login first to submit.