Chartist-js: TypeError: b.normalized[g].forEach is not a function

Created on 25 Jul 2015  路  6Comments  路  Source: gionkunz/chartist-js

Trying out Chartist by cloning master branch and using *.min.js and *.min.css in my code, while following http://gionkunz.github.io/chartist-js/getting-started.html . And I get the error

TypeError: b.normalized[g].forEach is not a function

Reproduced on Safari/Firefox/Chrome.

What am I doing wrong?

Most helpful comment

i managed to stumble on this issue too.

it happens, if the chart series is a 1-dimensional array instead of a two-dimensional one

here's a codepen with the error: http://codepen.io/laxis/pen/eNxaJJ?editors=001
jsbin: http://jsbin.com/vebegeyeki/1/edit?html,js,console,output
debugger screenshot:

hope it helps :)

All 6 comments

Can you reproduce it on JSBin with the latest version? http://jsbin.com/qerojadunu/edit?html,js,console,output

Seems to work on jsbin. I suppose its a bug on my side. I'll close this issue, and if I can reproduce it, I'll re-open it again. Thank you!

i managed to stumble on this issue too.

it happens, if the chart series is a 1-dimensional array instead of a two-dimensional one

here's a codepen with the error: http://codepen.io/laxis/pen/eNxaJJ?editors=001
jsbin: http://jsbin.com/vebegeyeki/1/edit?html,js,console,output
debugger screenshot:

hope it helps :)

Thanks for reproducting on jsbin! This make things a lot easier :-)

Series should always be an array of arrays! It's an array of data series.

http://jsbin.com/cuxama/edit?html,js,console,output

Cheers
Gion

Only pie charts or bar charts with the distributeSeries options are one dimensional arrays.

That's just solve my problem too ;) thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshiashish23 picture joshiashish23  路  3Comments

pathtoknowhere picture pathtoknowhere  路  4Comments

adilbenmoussa picture adilbenmoussa  路  4Comments

bluepineventures picture bluepineventures  路  4Comments

LandonSchropp picture LandonSchropp  路  3Comments