chartjs / chartjs/chartjs-adapter-moment

Uncaught TypeError: Cannot read property '_adapters' of undefined

Open
#33 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
37
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Hello maintainers!

I am working with Chart.js and Chartjs-adapter-moment to display a historical trend of up to 19 datasets using Flask. I am running into the issue where the adapter is returning the below error:

Uncaught TypeError: Cannot read property '_adapters' of undefined
at chartjs-adapter-moment.min.js:formatted:29
at chartjs-adapter-moment.min.js:formatted:8
at chartjs-adapter-moment.min.js:formatted:9

As well as this additional chart.js error:

Uncaught TypeError: Cannot read property 'left' of undefined
at _isPointInArea (chart.js:1339)
at getNearestItems (chart.js:1775)
at nearest (chart.js:1858)
at Chart.getElementsAtEventForMode (chart.js:6857)
at Chart._handleEvent (chart.js:7091)
at Chart._eventHandler (chart.js:7074)
at listener (chart.js:6971)
at Chart.event (chart.js:2431)
at chart.js:34

Versions:
Chart.js 3.2.0
Moment.js 2.29.1
Chartjs-adapter-momentjs 1.0.0

The time format is ISO 8601, and I had the implementation working on Chart.js version 2.6.0 but I needed to upgrade to get the zoom plugin to work. And now the chart will not build with the two above errors.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with Chart.js 3.2.0, Moment.js 2.29.1, and chartjs-adapter-momentjs 1.0.0, using the ISO 8601 time format and the historical multi-dataset chart described here. Start with the stack traces in chartjs-adapter-moment.min.js and chart.js; done means the chart builds without either reported TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.