c3js / c3

:bar_chart: A D3-based reusable chart library

Home Page:http://c3js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read properties of undefined (reading 'schemeCategory10')

aldrienht opened this issue · comments

  • C3 version: v0.7.0
  • D3 version: not using
  • Browser: Chrome
  • OS: OSX

ERROR: Uncaught TypeError: Cannot read properties of undefined (reading 'schemeCategory10')

SAMPLE CODE where error show up:

c3.generate({
      bindto: '#chart',
      data: {
        x:  'x',
        columns: [
          data['dates'],
          data['impressions'],
          data['clicks'],
          data['ctr'],
          data['positions']
        ]
      },
      axis: {
        x: {
          type: 'timeseries',
          tick: {
              format: '%Y-%m-%d'
          }
        }
      },
      tooltip: {
        format: {
          value: function (value, ratio, id) {
              .....
          }
        }
      }
    });

Solved - got it working by including d3.min.js
For c3.js version 0.7.0 - compatible d3 version is 5.16.0
https://cdnjs.cloudflare.com/ajax/libs/d3/5.16.0/d3.min.js