Home Forums Chart Support React itemClick with Boolean (JSFiddle given)

React itemClick with Boolean (JSFiddle given)

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

    MyTry

    I am using itemClick function to render the second chart.

    If the one of the x data point is clicked, the second chart is rendered.

    How can I check if the x data is clicked or not?

    MyRefer

    I am referring the above link but I could not have found a proper way.

    Please help me.

    #33921

    @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

    —-
    Manoj Mohan
    Team CanvasJS

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

You must be logged in to reply to this topic.