You must be logged in to post your query.
Home › Forums › Chart Support › Render Chart only when itemClick is clicked
Tagged: ItemClick, React
https://stackblitz.com/edit/canvasjs-react-chart-by-looping-2aerxd?file=index.js
I am trying to render the second chart only when the data is clicked in the first chart.
https://canvasjs.com/docs/charts/chart-options/data/click/
I referred the above link.
Can anybody help me?
@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
You must be logged in to reply to this topic. Login/Register