Home forums StockChart Support export chart button on react canvas chart

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #30923


    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.




    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

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.