deprecate / metal-clay-components

10 stars 14 forks source link

Changing column data leads to js error #159

Open bryceosterhaus opened 6 years ago

bryceosterhaus commented 6 years ago

Currently using jsx to render a pie chart. When I change the data passed into the columns prop, I get a js error in the console.

billboard.js:9310 Uncaught TypeError: Cannot convert undefined or null to object at Function.keys () at Chart.load (billboard.js:9310) at PieChart.handleColumnsChanged (ChartBase.js:360) at PieChart.runListeners (EventEmitter.js:463) at PieChart.emit (EventEmitter.js:189)

I think this stems from not having a default value for the colors arg on data items

Two data sets I am switching between.

[
    {
        data: [230, 190, 300, 500, 300, 400],
        id: 'data1',
    },
    {
        data: [50, 20, 10, 40, 15, 25],
        id: 'data2'
    }
]

[
    {
        data: [10],
        id: 'data3',
    },
    {
        data: [20],
        id: 'data4'
    }
]