Home Forums Chart Support Render Chart only when itemClick is clicked

Render Chart only when itemClick is clicked

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

    I am trying to render the second chart only when the data is clicked in the first chart.

    click

    I referred the above link.

    Can anybody help me?

    #33922

    @wellhys,

    You can render the second chart on clicking datapoints from the first chart using conditional rendering and react state. Please take a look at the code snippet below.

    {this.state.clicked && <CanvasJSChart
      options={options} 
    />}

    Also, check out this StackBlitz for an example with complete code.

    Render the second chart on datapoint click in React

    Considering this thread as duplicate of React itemClick with Boolean (JSFiddle given) and hence closing the same.

    —-
    Manoj Mohan
    Team CanvasJS

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

You must be logged in to reply to this topic.