SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
Good day.
Changing RolloverModifier SourceMode property to AllSeries, AllVisibleSeries and etc. take no effect.
In collection RolloverModifier.SeriesData.SeriesInfo we have only charts, that currently visible in chart field.
Is that bug?
Best regards
Sam
Hi Sam,
We have the example in our example suite called “Rollover callback”. There you can test SourceMode behavior: select appropriate mode in the dropbox on the top, select/deselect series by mouse clicks and observe series info reported in the legend. It seems to work as expected in the example, but feel free to post if you find something you believe is wrong.
Best regards,
Yuriy
Hi Sam,
Thanks for getting in touch. I was just talking to Yuriy about this. This behaviour is by design, since many users bind N RenderableSeries to a single DataSeries and use IsVisible to switch between them. Consider the SciTrader example has Line, Candlestick, Mountain, Ohlc RenderableSeries types all bound to a single OhlcDataSeries. IsVisible is used to change the render-series type currently visible.
In the case the rollover showed these it would main the main OHLC series would be reported 4 times in the tooltip. Also for other cases where series are invisible, it would mean the rollover bullets would be hovering in the chart but with no series.
Just out of interest, what is it you want to achieve, and why do you need the values of invisible series reported by the rollover?
Best regards,
Andrew
Hi there,
We are going to provide a way to customize this rollover behavior via inheritance in the next update. For now, it is quite difficult to change it because of amount of code you need to write in derived class. It is possible to get all series values in certain point as you suggested via IRenderableSeries.HitTest(..) method:
private void SciChartSurfaceMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { // Perform the hit test relative to the GridLinesPanel var hitTestPoint = e.GetPosition(sciChartSurface.GridLinesPanel as UIElement); foreach (var renderableSeries in sciChartSurface.RenderableSeries) { // Perform hit test operation with interpolation HitTestInfo hitTestInfo = renderableSeries.HitTest(hitTestPoint, true); var seriesInfo = renderableSeries.GetSeriesInfo(hitTestInfo); } }
You could use this approach as a workaround till the next update. Please, let us know if it is suitable for you.
Best regards,
Yuriy
Its make me crazy, but I did it! 😀
Firstly I expand FastLineRenderableSeries with auxiliary field CurrentCursorValue
public class MyFastLineRenderableSeries : FastLineRenderableSeries, INotifyPropertyChanged { private String _CurrentCursorValue; public String CurrentCursorValue { get { return this._CurrentCursorValue; } set { if (this._CurrentCursorValue == value) return; this._CurrentCursorValue = value; OnPropertyChanged("CurrentCursorValue"); } } [field: NonSerialized] public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string info) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(info)); } } }
Then, I process OnMouseMove event to fill up this field in all series
private void scichart_PreviewMouseMove(object sender, MouseEventArgs e) { //get current X position Point mousePoint = e.GetPosition(scichart.ModifierSurface as UIElement); DateTime xDataValue = (DateTime)scichart.XAxis.GetDataValue(mousePoint.X); foreach (MyFastLineRenderableSeries renderableSeries in scichart.RenderableSeries) { int index = renderableSeries.DataSeries.FindIndex(xDataValue, SearchMode.Nearest); if (index == -1) renderableSeries.CurrentCursorValue = "---"; else { renderableSeries.CurrentCursorValue = ((double)renderableSeries.DataSeries.YValues[index]).ToString("F2"); if(renderableSeries.CurrentCursorValue=="NaN") renderableSeries.CurrentCursorValue = "---"; } } }
Finally, I create my custom legend control with special fields binded to CurrentCursorValue
PS
HitTestInfo hitTestInfo = renderableSeries.HitTest(hitTestPoint, true);
not work correctly when Xaxis Range updated in separate thread (every 10 ms scrolling)
Please login first to submit.