score:5
Accepted answer
I found my error! The the creation of the radar comes at the top of the code before I declare any of the data or options.
var myRadarChart = new Chart(ctx).Radar(data, options);
This line must be placed at the bottom of the function
$(function () {
var ctx = $('#myCanv').get(0).getContext("2d");
var data = {
labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
datasets: [
{
label: "My First dataset",
fillColor: "rgba(220,220,220,0.2)",
strokeColor: "rgba(220,220,220,1)",
pointColor: "rgba(220,220,220,1)",
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(220,220,220,1)",
data: [65, 59, 90, 81, 56, 55, 40]
},
{
label: "My Second dataset",
fillColor: "rgba(151,187,205,0.2)",
strokeColor: "rgba(151,187,205,1)",
pointColor: "rgba(151,187,205,1)",
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(151,187,205,1)",
data: [28, 48, 40, 19, 96, 27, 100]
}
]
};
var myRadarChart = new Chart(ctx).Radar(data, options);
});
Source: stackoverflow.com
Related Query
- Chart Js Cannot read property 'length' of undefined
- Uncaught TypeError: Cannot read property 'offsetWidth' of undefined - chart.js
- Chartjs cannot read property datasets of undefined
- TypeError: Cannot read property 'defaults' of undefined when using the react wrapper of chartjs
- Cannot read property 'labels' of undefined
- Chart.js Cannot read property 'fontSize' of undefined
- TypeError: Cannot read property 'legend' of undefined | Angular + ng2-charts
- ChartJS: Uncaught TypeError: Cannot read property 'call' of undefined
- Uncaught TypeError: Cannot read property 'draw' of undefined
- Ionic/Chart.js - Cannot read property 'nativeElement' of undefined
- chartjs - multi axis line chart - cannot read property 'min' of undefined
- Updating Chart.js with JSON, cannot read property 'length' of undefined
- chartjs & asp.net: Cannot read property 'labels' of undefined
- Angular / ng2-charts: Fetching json data in chart object showing: Cannot read property 'length' of undefined
- Uncaught TypeError: Cannot read property 'draw' of undefined : Angular chart js
- Cannot read property 'reactiveProp' of undefined in vue-chartjs
- react-chartjs integration error. Cannot read property 'xLabels' of undefined
- Chartjs + Vue.js - Cannot read property '_meta' of undefined
- chartjs; cannot read property '0' of undefined
- Chart.js Cannot read property 'apply' of undefined
- Cannot read property 'length' of undefined for ChartJS when I use it inside React
- Chart JS Error : Uncaught TypeError: Cannot read property 'top' of undefined
- react-chartjs error Cannot read property 'Chart' of undefined
- Uncaught TypeError: Cannot read property 'draw' of undefined for object scale
- ERROR TypeError: Cannot read property 'testMethod' of undefined
- Uncaught (in promise) TypeError: Cannot read property 'length' of undefined in chartjs with Vuejs
- Angular and CharJS - ERROR TypeError: Cannot read property '15' of undefined
- Uncaught TypeError: Cannot read property 'format' of undefined
- Angular4 ng2-charts TypeError: Cannot read property 'length' of undefined
- ERROR TypeError: Cannot read property 'nativeElement' of undefined in Ionic 5 and chart.js
More Query from same tag
- Is there any way to use 2 different color for the same bar in a chart?
- Chart.js - cannot read property
- AngularJS Pagination not showing all pages
- Adding multiple dataset and colors not being assigned in ng2-charts
- Chart.js how to make chart only show the most recent data
- How to add an extra legend item in chart.js?
- Grabbing the title in plugin for ChartJS
- I can't change the color of the grids in Chart.js
- Add mouseout event handler to legends in Chart.js
- Bootstrap grid not working with canvas
- Chart.js graph with just two cordinates
- How to make lines in line charts from ng2-charts straight lines?
- Chartjs display label & units when mouse is hover stats
- onZoom not triggered when zooming
- Chart.js - How to create a different global configuration between the x axis and the y axis
- Chart.js Version 1 differences and can they be achieved in version 2?
- Data not displaying in Chart JS from PHP JSON
- Display Time In Y Axis - Bubble Chart
- How to create a chart-js pie chart with PHP data variables?
- Angular2 + Chart.js and ng2-charts. Data binding not working as expected
- Trying to get total sum based on months on ApexCharts with Php
- Custom Legend with ChartJS v2.0
- How to change z-index of chart js tooltip?
- Understanding the data flow when fetching chart data using AJAX
- Chartjs - Line between two dots on the Y axis
- Show only nth tick LINE on x-axis for Chart.js diagram
- Chart JS can't access data from array within an object
- how to only show zero grid axes at center and hide all other gridlines in chart js
- Ionic not return data from variable
- ChartJs - width scale of chart area and label area