reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

getSegmentsAtEvent ? #153

Closed amangeot closed 7 years ago

amangeot commented 7 years ago

Hello, I would like to use a Doughnut Chart in a dynamic way. I want to change the color of an element on click events.

How can we use getSegmentsAtEvent with the current react-chartjs API ?

I can't find any documentation about events,

amangeot commented 7 years ago

Sorry, just found another issue with an example.

I'll paste it here if it can help:

handleClick = (e) => {
    const activePoints = this.refs.doughnut.getSegmentsAtEvent(e)
 }
<Doughnut data={data} options={options} ref='doughnut' onClick={this.handleClick} />