I would like to add a treemap chart from chartjs-chart-treemap into my existing project that uses react-chartjs-2.
I tried so far:
import ChartComponent from 'react-chartjs-2';
export default class TreeMap extends React.Component {
render() {
return (
<ChartComponent
{...this.props}
ref={ref => this.chartInstance = ref && ref.chartInstance}
type='treemap'
/>
);
}
}
,but I can see following error when trying to render this component:
Error: "treemap" is not a chart type.
How can I use chartjs-chart-treemap with React?