Home › Forums › Chart Support › Render Chart only when itemClick is clicked › Reply To: Render Chart only when itemClick is clicked
@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.
Considering this thread as duplicate of React itemClick with Boolean (JSFiddle given) and hence closing the same.
—- Manoj Mohan Team CanvasJS