[Chartjs]-Integrate chartjs-chart-treemap with react-chartjs-2

3👍

the chartjs-chart-treemap library has to be imported to the component file

import ChartComponent from 'react-chartjs-2';
import 'chartjs-chart-treemap';


export default class TreeMap extends React.Component {
    render() {
        return (
            <ChartComponent
                {...this.props}
                ref={ref => this.chartInstance = ref && ref.chartInstance}
                type='treemap'
            />
        );
    }
}

Leave a comment