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

Donut chart data structure #32

Closed chrise86 closed 5 years ago

chrise86 commented 5 years ago

I'm trying to replicate this example with 2 datasets. I have set the correct adapter, and my data is currently as follows:

<PieChart
  stacked
  donut={true}
  data={[{
    name: 'US',
    data: [
      ['Demand', usDemand],
      ['Spares', usSpares],
      ['Backups', usBackups]
    ]
  }, {
    name: 'CA',
    data: [
      ['Demand', caDemand],
      ['Spares', caSpares],
      ['Backups', caBackups]
    ]
  }, {
    name: 'ROW',
    data: [
      ['Demand', rowDemand],
      ['Spares', rowSpares],
      ['Backups', rowBackups]
    ]
  }]}
  colors={['#305994', '#69CA7E', '#8B59C8', '#AAAAAA']}
/>

and I'm already getting a blank chart. When I inspect the React component with dev tools the data prop looks like this:

screenshot 2018-10-25 at 11 59 50

I have tried with and without the stacked prop. Can you explain how to do this please?

ankane commented 5 years ago

Hey @chrise86, Chartkick only supports single-series pie charts.

ankane commented 5 years ago

Cleaning up stale issues