SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

0
0

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

  • You must to post comments
0
0

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

  • binni
    Good example, but I cant change series IsVisible property, or scroll (zoom) chart field to make some series hidden. In this case invisible series not present in collection RolloverModifier.SeriesData.SeriesInfo аlthough that SourceMode=AllSeries.
  • binni
    I add to "Rollover callback" example zoom/scroll modifiers. Invisible series not presented in RolloverModifier.SeriesData.SeriesInfo (SourceMode=AllSeries)
  • binni
    And if SeriesA.IsVisible = false this series not present in RolloverModifier.SeriesData.SeriesInfo too (SourceMode=AllSeries).
  • You must to post comments
0
0

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

  • binni
    :( I am afraid that my level of English will not allow me to clearly explain why do I need show in rollower invisible series.I think that RolloverModifier.SourceMode work similar to LegendModifier.GetLegendDataFor. If RolloverModifier.SourceMode=AllSeries, then in collection RolloverModifier.SeriesData.SeriesInfo present ALL series.
  • binni
    Or may be there is a way to get all series (nearest to mouse) values by processing mouse position (in code)?
  • You must to post comments
0
0

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

  • You must to post comments
0
0

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)

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.