How to highlight a data series / data point in OnMouseMove ?


Author
Message
joern kunze
joern kunze
Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)
Group: Forum Members
Posts: 86, Visits: 221
Hi Experts,

I have the following problem:
Nevron Chart with several data series (NPointSeries) (e.g. 200 series with 20000 points each)
The data series are to be displayed with different colours and when the mouse pointer is moved over a data point, this data point must be highlighted and the series it belongs to should be highlighted too.

My present solution looks as follows:

// Chart initializing: Before creating the "real" data series I create 2 "special" series additionaly :
// one for the hightlighted point, one for the highlighted serie
NPointSeries _seriesHighlightingPoint = getNewNevronSerie();
_seriesHighlightingPoint.AddDataPoint(new NDataPoint(double.NaN, double.NaN));
_oChart.Series.Add(_seriesHighlightingPoint);

NPointSeries _seriesHighlightingSeries = getNewNevronSerie();
_oChart.Series.Add(_seriesHighlightingSeries);

// In the appropriate mouse move event I determine the point / series where mouse is pointing to
// and assign this point / series to _seriesHighlightingPoint / _seriesHighlightingSeries
_seriesHighlightingPoint.XValues.SetValue(0,double)seriesSel.XValues.GetValueForIndex(SelectedPoint));
_seriesHighlightingPoint.Values.SetValue(0,(double)seriesSel.Values.GetValueForIndex(SelectedPoint));

_oChart.Series[1] = seriesMouseCursorPointsTo;

This is working quite as expected - with one problems I cant solve:

In the Chart legend I can easily disable the legend for the selected point:
((NPointSeries)_oChart.Series[0]).Legend.Mode = SeriesLegendMode.None;
But since the highlighted serie is just a reference, I cant do it that way for _seriesHighlightingSeries since this will disable the legend for the underlying data serie as well.

Is there an easy solution to disable the shown legend for _oChart.Series[1] (which is just - for instance - a reference to lets say _oChart.Series[5]) and keep the legend entry for the referenced serie (_oChart.Series[5]) ?
Or is it possible to separate the legend entry for _oChart.Series[1] so that it is displayed somehow appart from the "nomal" legend for the "real" data series?

Or may be you have got a better approach / easier solution for doing the highlighting of a serie / point in the MouseMoveEvent already?

Thank you very much for your help,
Best regards,
Joern


Reply
joern kunze
joern kunze
Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)
Group: Forum Members
Posts: 86, Visits: 221
... thanks for the advice. I just run into a problem when the series is added twice (ok - you already adviced that it is not a good idea) on a Win2003 server system. The application crashes, when the series is added twice, e.g.:
_oNevronChart.Series[0] = _oNevronChart.Series[7];

On several computers (Win7, 64bit) this is working with exactly the same data without any problems, though.

Is there another simple way to bring the series topmost or do I have to always copy the data of the series I want to bring into foreground (since the data is rather huge, I would like to avoid this) ?

Thanks a lot,
Best regards,
Joern

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search