8

React Charts 2 https://github.com/gor181/react-chartjs-2

is referencing below

Chart JS http://www.chartjs.org/docs/#getting-started

The docs in react-chartjs-2 references chart.js docs and they're all wrong. I can't figure out how to configure the charts in react, specifically the options. Does anybody know?

ProgrammingGodJK
  • 207
  • 1
  • 3
  • 10
  • 1
    Any answer for your demand? I'm having the same problem and can't find a proper documentation. – Alk Feb 18 '19 at 12:54

1 Answers1

21
<Bar
    data={{
      labels: this.props.labels,
      datasets: this.props.data
    }}
     options={{
       legend: {
         display: false
       },
       scales: {
         yAxes: [{
           ticks: {
              max: this.props.maxY,
              min: 0,
              stepSize: 3
            }
          }]
         },
        title: {
         display: this.props.display,
         text: this.props.title
        }
     }}
/>
Stef12
  • 211
  • 1
  • 6
  • 8
    Welcome to Stack Overflow. It's always a good idea to add some explanation text to the code you post in answers to prevent them from being flagged as low quality. – Matthew Strawbridge May 23 '17 at 11:31