Closed texas697 closed 3 years ago
Hi @texas697
I was not able to run you example, but I tried a similar one where on change I clear RenderableSeries. Please note the sciChartSurface.renderableSeries.clear() just removes all renderable series from the SciChartSurface. To prevent memory leaks you also need to delete renderableSeries and dataSeries.
sciChartSurface.renderableSeries.asArray().forEach(rs => {
rs.dataSeries.delete();
rs.delete();
});
sciChartSurface.renderableSeries.clear();
const newDataSeries = new OhlcDataSeries(wasmContext, {
xValues: getXValues(interval),
openValues,
highValues,
lowValues,
closeValues
});
const newRenderableSeries = new FastCandlestickRenderableSeries(wasmContext, {
strokeThickness: 2,
dataSeries: newDataSeries,
dataPointWidth: 0.5,
paletteProvider: new MyPaletteProvider(917222400, 917827200),
opacity: 0.75
});
sciChartSurface.renderableSeries.add(newRenderableSeries);
My example works without any problem. If you are still experiencing this issue please provide the sample project I can just install and run to reproduce the problem.
Point of discussion:
Should RenderableSeries.clear() also delete? We could potentially make this an optional flag in .clear() e.g.
sciChartSurface.renderableSeries.clear(deleteChildren: boolean = true);
On Wed, Apr 28, 2021 at 11:04 AM Michael Klishevich < @.***> wrote:
Hi @texas697 https://github.com/texas697
I was not able to run you example, but I tried a similar one where on change I clear RenderableSeries. Please note the sciChartSurface.renderableSeries.clear() just removes all renderable series from the SciChartSurface. To prevent memory leaks you also need to delete renderableSeries and dataSeries.
sciChartSurface.renderableSeries.asArray().forEach(rs => { rs.dataSeries.delete(); rs.delete(); }); sciChartSurface.renderableSeries.clear(); const newDataSeries = new OhlcDataSeries(wasmContext, { xValues: getXValues(interval), openValues, highValues, lowValues, closeValues }); const newRenderableSeries = new FastCandlestickRenderableSeries(wasmContext, { strokeThickness: 2, dataSeries: newDataSeries, dataPointWidth: 0.5, paletteProvider: new MyPaletteProvider(917222400, 917827200), opacity: 0.75 }); sciChartSurface.renderableSeries.add(newRenderableSeries);
My example works without any problem. If you are still experiencing this issue please provide the sample project I can just install and run to reproduce the problem.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ABTSoftware/SciChart.JS.Examples/issues/82#issuecomment-828329661, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADLEDVLYS3G2KSDBYXVHWGDTK7MTJANCNFSM43TZAXBA .
Hi @texas697 In fact there was a bug, when removing/clearing renderableSeries with RolloverModifier added to SciChartSurface, we have fixed it in version 1.4.1578.
same issue as this ticket. https://github.com/ABTSoftware/SciChart.JS.Examples/issues/78
"scichart": "1.4.1566"
"drawChart.js"
"updateChartWithData.js"
"LineChart.js"
Also if possible maybe you can see why the tooltip is not updating the styles after changing themes. It doesn't make the change until I change chart types. I assume that is because the Chart is being re-created. :-).
The logic is based from this closed ticket. https://github.com/ABTSoftware/SciChart.JS.Examples/issues/57