score:6

Accepted answer

react chartjs has a dependency on chart.js too. install it like

npm install --save chart.js@^1.1.1 react react-dom

also since line is a named export you need to import it as

import {line as linechart} from 'react-chartjs';

also make sure your chartdata is an object like

{
    labels: ["january", "february", "march", "april", "may", "june", "july"],
    datasets: [
        {
            label: "my first dataset",
            fill: false,
            pointhoverradius: 5,
            pointradius: 1,
            pointhitradius: 10,
            data: [65, 59, 80, 81, 56, 55, 40],
            spangaps: false,
        }
    ]
};

Related Query

More Query from same tag