Profile Picture

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

Posted By joern kunze 12 Years Ago

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

Author
Message
joern kunze
Posted 12 Years Ago
View Quick Profile
Junior Member

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
Last Active: 3 Months Ago
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






Similar Topics


Reading This Topic