Skip to content Skip to sidebar Skip to footer

'scales' Option Appears To Break Chart.js Graph

I'm trying to include a line chart for some stock data in my django project using Chart.js. I can render a simple chart with the data I want just fine, but when I try to format the

Solution 1:

It seems to work for me. Have you checked in your browser to make sure you're not getting any JS exceptions being thrown that are preventing the chart from being displayed?

Specifically, I believe you need to include the moment module (https://momentjs.com/) in order to use

type: 'time'

If the module is not loading for some reason, it could be throwing an exception and giving you a blank chart.

Here's another reference describing a similar problem: ChartJS not displaying time data using Moment.js


Post a Comment for "'scales' Option Appears To Break Chart.js Graph"