score:0
Accepted answer
when you push outside of the loop you are actually pushing verserier into position [n], which in this case is 0.
if you do not add values again you can do
chart.data.labels = verserier
score:0
i don't have the explanation of the "why", but here's a workaround :
var data_array = new array();
// this doesn't work (but with no error on my side, appart from visually wrong labels)
mychart.data.labels.push(data_array);
// but this works
for(i=0;i<data_array.length;i++)
{
mychart.data.labels.push(data_array[i]);
}
Source: stackoverflow.com
Related Query
- chartjs push array to label not working
- Chartjs not working with d3 from csv source
- show label in tooltip but not in x axis for chartjs line chart
- Chartjs bar dataset label not showing
- ChartJS multiple tooltip callbacks not working
- ChartJS do not render any legend if the label is falsy
- showing tooltips all the time in chartjs 2.4 not working
- ChartJS - radar chart options not working
- Bubble Chart in Chartjs not working
- Chartjs - Donut Chart label for small values not visible
- code works fine on jsfiddle but one function is not working on website
- zeroLineColor and zeroLineWidth not working for the x-axis in Chartjs
- HTML 5 chartjs not working as static file
- Bootstrap modal not working with chartjs line graph
- 'barradius' for Barchart in ChartJS is not working
- ChartJS not working in Vue
- Background color of the chart area in chartjs not working
- Chartjs with Vue, Bar Chart Border Radius not working
- Multiple data sets not working when using ChartJS
- Label is not showing in ChartJS
- padding not working in my chartjs line-graph
- Legend color not working with randomly generated background colors in chartjs pie chart
- chartjs stack bar graph color not working
- ChartJS autoskip:False not working on line chart
- ChartJS BoxWidth not working
- Chartjs fiddle not working
- ChartJs is not working in angular 4 with no errors
- Why ChartJs is not working in IE
- ChartJs DrawBorder() Configuration not working
- Chartjs using array in label field
More Query from same tag
- How to add image to chart.js tooltip?
- Chart.Mvc scale begin at 0 - Nullable bool property remains null
- Chartjs Bar Chart Y Axis set base starting value to not be 0
- Convert PHP array to chart.js compatible data
- Javascript / JSON error: TypeError: myObj is undefined
- Give '%' on Bar Chart Datalabel Chartjs
- How to color legend in angular-chart.js
- ChartJS how to sync animations when page loads
- ChartJS: Change the positions of the tooltips
- Angular 8 and ng2 charts - Updating labels and data
- Chartjs - Changing legend as a line with pointsyle of circle?
- Doughnut spacing
- Chart.js two columns on page - left column is squished until page resize
- Moving Data To Object Within Array
- HTML: How to get rid of overlapping
- How to set a minimum width on the values in a doughnut chart?
- passing each element of array in the labels of char.js
- Chart.JS Data Element To Be settled as Euro Currency
- How to ignore same values on ChartJs?
- Use multi data to draw chart with chartjs
- Using a prepared dataset in chart.js
- Chart.js plugin datalabels - formatter- Add space between thousands
- Click on Element Inside Doughnut Chart
- Drilldown on barchart using CHARTJS Devexpress
- How to use GET method to choose the right table to show ChartJS graph?
- Chartjs extended doughnut with text tooltip issue
- Chart.js charts not rendering data until I inspect element, is it because of async?
- Colors not showing up on charts in ionic 3
- Change point size and color on hover in chartjs
- Multiple Axis Line Chart