Hello everyone. A similar question has already been asked just below the forum, but there is no answer. I have dynamically added diagrams. However, I am interested in the possibility of adding buttons for closing and collapsing diagrams directly to the chart panel. I need the option to close any selected chart. How can this be implemented and written? Thank you.
- Alicia Sevastian asked 1 year ago
- You must login to post comments
We don’t have a demo of this yet, but it is very simple
- Add a button to your application
- In the onClick handler, call
sciChartSurface.delete()
. - Make sure that
sciChartSurface.domChartRoot
is removed from your HTML DOM
Code might look like this:
button.onClick = () => {
sciChartSurface.delete(true);
sciChartSurface.domChartRoot.remove();
}
If you have other subscriptions, synchronisations or event handling make sure you cleanup those too.
Best regards
Andrew
- Andrew Burnett-Thompson answered 1 year ago
- last edited 1 year ago
- Update: we do now have an example of this in our JS demo. Does this forum question and answer help? https://www.scichart.com/questions/js/can-add-indicators-to-chart-dynamically
- You must login to post comments
Please login first to submit.