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

#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