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

1
0

I have been working with the new Overview Chart feature available in the new 2.0.0-beta.2084 release, and ran into an issue where I can remove lines from the overview surface no problem, but then I always receive an error whenever I try to add one.

I was just wondering if there is a recommended flow for when a parent chart’s renderable series array has traces added or removed. One thing I did try to circumvent this issue was to delete the old overview and add a new one, but I receive either a separate error or the overview would draw without any traces.

I have attached a file with example code that should display the error I receive when you add a line to an overview component. I have also attached an image of the error that appears in the console.

Version
2.0.0-beta.2084
Images
  • You must to post comments
1
0

Hello Drew,

Accordingly to the error message you can’t attach the same Renderable Series to different surfaces.
The described issue is caused by the following code:

        scichartOverview.parentSciChartSurface.renderableSeries.add(newLineSeries);
        if (scichartOverview !== null) {
            scichartOverview.overviewSciChartSurface.renderableSeries.add(newLineSeries);
        }

where you are trying to add “newLineSeries” into different collections.

So to resolve the issue, you can create a copy of the “newLineSeries” and pass it separately:

       const options = {
            dataSeries: dataseries,
            strokeThickness: 2,
            stroke: newColor
        };
        const newLineSeries = new FastLineRenderableSeries(wasmContext, options);
        const newLineSeriesForOverview = new FastLineRenderableSeries(wasmContext, options);

        scichartOverview.parentSciChartSurface.renderableSeries.add(newLineSeries);
        if (scichartOverview !== null) {
            scichartOverview.overviewSciChartSurface.renderableSeries.add(newLineSeriesForOverview);
        }

Now you will have 2 instances of FastLineRenderableSeries which will use the same dataSeries.

Best Regards,
Ivan

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.