You must be logged in to post your query.
Home › Forums › StockChart Support › export chart button on react canvas chart
Hello,
I am using canvas chart on my react project,I want to export the chart on click of of a button outside the chart, chart.exportChart({format: "jpg"}); I have tried to use chart.exportChart(), but it seems this is not a react specific function. Is there a way to do that.
chart.exportChart({format: "jpg"});
Thanks!
@shashank,
You can get the reference to the chart instance by passing onRef = {ref => this.chart = ref} props to the component, which you can use to export chart on clicking button. Please refer React Integration documentation for more information. Also take a look at this StackBlitz for an example.
— Vishwas R Team CanvasJS
You must be logged in to reply to this topic. Login/Register