reactjs / react-chartjs

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

How to resize the chart manually? #44

Closed f15gdsy closed 8 years ago

f15gdsy commented 8 years ago

Hi I want to resize the chart manually, how should I do it? I'm looking for something like:

// In parent
this.refs.chart.resize(width, height);
f15gdsy commented 8 years ago

Oh, I figured it out. One have to pass

width = {myWidth}
height = {myHeight}
redraw = {true}

as props to the chart component to make the chart to redraw to the preferred size.