Chart.js: [BUG] Line chart does not render data lines on iOS

Created on 6 May 2020  路  2Comments  路  Source: chartjs/Chart.js

Expected Behavior

Lines for the data sets should be visible on the line chart.

Current Behavior

When viewed on desktop, everything works as expected. When viewed on iOS (iPad, iPhone, etc) the lines are not shown on the line chart.

Steps to Reproduce (for bugs)

See example here: https://jsfiddle.net/9pcuvthy/. It is using the bundled 2.9.3 version. The bug appears on all mobile browsers (Chrome, Firefox, and Safari).

You can view it on iOS or using https://www.browserstack.com/ to see the problem in action.

bug

Most helpful comment

I figured it out, thanks to a warning SO showed in the code examaple.

The problem is that the dates I was passing in were not in ISO standard format, and therefore moments() was defaulting to the standard date() which does not work on all browsers.

I changed around the format and it now works fine.

See here for anyone else having the same problem: https://stackoverflow.com/questions/61632278/chart-js-line-chart-does-not-render-data-lines-on-ios/61647065#61647065

All 2 comments

I figured it out, thanks to a warning SO showed in the code examaple.

The problem is that the dates I was passing in were not in ISO standard format, and therefore moments() was defaulting to the standard date() which does not work on all browsers.

I changed around the format and it now works fine.

See here for anyone else having the same problem: https://stackoverflow.com/questions/61632278/chart-js-line-chart-does-not-render-data-lines-on-ios/61647065#61647065

Thanks for sharing the solution! I will close this since it sounds like you figured it out

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akashrajkn picture akashrajkn  路  3Comments

joebirkin picture joebirkin  路  3Comments

gouthamrv picture gouthamrv  路  3Comments

gabrieldesouza picture gabrieldesouza  路  3Comments

JewelsJLF picture JewelsJLF  路  3Comments