Chart.js: "Cannot read property 'length' of undefined" when using bars on time series without 'labels' defined

Created on 27 May 2016  路  3Comments  路  Source: chartjs/Chart.js

Creating a bar dataset with xAxis of type "type" can result in error "Cannot read property 'length' of undefined". Should add check for definition of data.labels before checking the length.

Adding empty labels[] to data avoids the error, but bars are drawn.

https://jsfiddle.net/dotacoach/p8vLm0bj/5/

time scale bug

All 3 comments

Adding the an empty Array literal for "labels" worked for me:

I think the label issue is fixed in master but still need #4673 for the {x, y} bar data.

Fixed in master (https://jsfiddle.net/p8vLm0bj/19/)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bytesnz picture bytesnz  路  3Comments

NODRAJ picture NODRAJ  路  3Comments

JAIOMP picture JAIOMP  路  3Comments

SylarRuby picture SylarRuby  路  3Comments

frlinw picture frlinw  路  3Comments