ankane / react-chartkick

Create beautiful JavaScript charts with one line of React
https://chartkick.com/react
MIT License
1.2k stars 58 forks source link

[Question] Dataset Properties? #13

Closed jordanoverbye closed 6 years ago

jordanoverbye commented 6 years ago

Hello, is it possible to set any chart js dataset properties? (http://www.chartjs.org/docs/latest/charts/line.html#dataset-properties). It seems like you can only set label(name) and data.

For example:

data = [
  {
    "name":"Workout", 
    "data": {"2017-01-01": 3, "2017-01-02": 4}},
    "backgroundColor": "#00ff00",
    "borderWidth": "5",
  }, {
    ...
  }
];

<LineChart data={data} />
ankane commented 6 years ago

Hey @jordanoverbye, it's not currently documented, but you can add a library option on the same level as name and data to set dataset properties for Chart.js.

ankane commented 6 years ago

Cleaning up stale issues. Hope the recommendation above helped @jordanoverbye

jordanoverbye commented 6 years ago

Thanks @ankane!