scatter chart v3.0.0-rc.2: Uncaught (in promise) TypeError: Cannot read property 'value' of undefined
See original GitHub issueExpected Behavior
I can’t find the bug, since the new version I got the bug. However, this does not occur in simple test cases.
What options do I have to isolate the error?
it happens if i set the defaults.layout.paddings
this.ChartControl = window.Chart3 || Chart
if (this.ChartControl.defaults.layout && this.ChartControl.defaults.layout.padding) {
this.ChartControl.defaults.layout.padding = {
top: 24,
left: 0,
right: 0,
bottom: 0
}
}
chart.js?module:3593 Uncaught (in promise) TypeError: Cannot read property ‘value’ of undefined
options = {
type: "scatter",
data: {
labels: [],
datasets: [{
label: "Reni",
unit: "%",
hoverRadius: 18,
pointRadius: 16,
hitRadius: 22,
backgroundColor: "rgba(192,57,43,0.85)",
borderColor: "rgba(192,57,43,0.85)",
data: [{
x: 17.65,
y: 17.8
},
{
x: 17.65,
y: 17.8
},
{
x: 18.01,
y: 17.84
},
{
x: 17.61,
y: 17.95
},
{
x: 17.78,
y: 17.87
},
{
x: 16.76,
y: 17.98
}
]
},
{
label: "Peter",
unit: "%",
hoverRadius: 18,
pointRadius: 16,
hitRadius: 22,
backgroundColor: "rgba(230,126,34,0.85)",
borderColor: "rgba(230,126,34,0.85)",
data: [{
x: 12.36,
y: 22.51
},
{
x: 12.23,
y: 22.42
},
{
x: 12.23,
y: 22.42
},
{
x: 12.22,
y: 22.48
},
{
x: 12.51,
y: 22.6
},
{
x: 12.25,
y: 22.45
},
{
x: 12.35,
y: 22.53
}
]
}
]
},
options: {
units: "",
layout: {},
chartArea: {
backgroundColor: "transparent"
},
hover: {
mode: "nearest",
intersect: true
},
elements: {},
spanGaps: true,
plugins: {
title: {},
tooltip: {},
legend: {
display: true,
position: "top"
},
scales: {}
},
animation: {},
onResize: null
}
}
Environment
- Chart.js version: v3.0.0-rc.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Pre-release v3.0.0-rc.3 - scatter chart: Render Graph Error on ...
kurkle mentioned this issue on Mar 24, 2021. scatter chart v3.0.0-rc.2: Uncaught (in promise) TypeError: Cannot read property 'value' of undefined #8702.
Read more >Uncaught (in promise) TypeError: Cannot read property '0' of ...
as you've discovered, the function gets called from the callback method without the data. however, it is not a good idea to remove...
Read more >ng2-charts | Yarn - Package Manager
Reactive, responsive, beautiful charts for Angular based on Chart.js ... NG0303: Can't bind to 'type' since it isn't a known property of 'canvas'...
Read more >Fix 'cannot read properties of undefined (reading map)' in JS
The "Uncaught TypeError: Cannot read properties of undefined (reading 'map')" error occurs in JavaScript, whenever you try to use the array ...
Read more >Visualization: Scatter Chart - Google Developers
Overview. Scatter charts plot points on a graph. When the user hovers over the points, tooltips are displayed with more information. Google scatter...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah ok, looking at that one seems like it could be the re-rendering of the chart. I do get a new instance every time my chart redraws, but the old instance does get destroyed.
I am using react and useLayoutEffect to achieve the re-renders. If this helps in any way:
@thepedroferrari ok, I was just hoping your issue was the same as now occurs in #8708