score:8
The labels requires a array variable but the var lbls = $('#lbls').html()
returns a string so splitting it with ',' will do the job
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: lbls.split(','),
datasets: [{
label: '# of Votes',
data: [20, 10]
}]
}
});
Source: stackoverflow.com
Related Query
- angular-chartjs line chart TypeError: t.merge is not a function
- Chart.js update function (chart,labels,data) will not update the chart
- code works fine on jsfiddle but one function is not working on website
- $scope variable do not respond to the onClick function of angular chart
- Destroying chart.js is not working when chart created inside function - chart.destroy() is not a function
- 【React chart.js】How to add multiple data to Radar chart using map function
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- How to fix map is not function even there is already set data in the useState using React Hook
- chartjs line graph destroy function is not clearing the old chart instances
- e.labels.map is not a function when creating a chart with chart.js
- how to not repeat code while creating multiple charts in chart js
- ReferenceError: Chart is not defined - chartjs
- Chart.js: bar chart first bar and last bar not displaying in full
- Chart.js responsive option - Chart not filling container
- show label in tooltip but not in x axis for chartjs line chart
- using vue-chartjs in vue 3 : createElement is not a function
- Html chart does not fit a small Android WebView
- Chart.js ng2-charts colors in pie chart not showing
- Chart.JS Mixed Chart - Bars Not Showing
- Chart looks only grey, does not show the color - Chartjs,discordjs
- Angular-chart.js - Make line chart does not curve
- Center point labels between ticks (Polar Area Chart JS)
- Blank PNG image using Chart JS . toBase64Image() function
- Chart.js line chart is not displaying
- Chart.js: width and height of a pie chart not respected
- Chart.js t.ticks.map is not a function
- Uncaught TypeError: Chart is not a constructor when using Chart.js
- Map event position to y axis value in chartjs line chart
- Line chart is not being displayed in Chart.js
- Series Details Not Showing in Angular Chart with Charts.js
More Query from same tag
- Edit tooltips in ChartJS
- How to add label in chart.js for polar chart area
- Update charts in chartjs and angular
- display ng2 chart when the property of data returned is >=0
- Is it posssible to create a Line-Chart with only 2 values? - Chart.js
- Passing text to a popup window opened in a JS function
- Reopening a "ChartJS" chart in a new window (VS, C#, ChartJS)
- How to show lables just outside the the doughnut chart in Chartjs?
- Highlight chart element when hovering over its corresponding legend Item
- how to show information of hidden bar graphs also in a Tooltip using chart.js in angular?
- Chart.js Version 3: how to set the different color for tick lines and gridlines
- Legend option destroys pie chart in Chart.js
- I am using Chart.js and want to change the tool tip to display date format based on timestamp input
- Click on Element Inside Doughnut Chart
- Modifying values in a radar chart.js based on user input
- How to slice list items in Django Template using javascript (or similar)
- Charts doesn't appear
- Vuejs - Chartjs - turning a doughnut chart to a gauge - rotation
- Unable to make y-axis to begin at zero on Charts.js v2.1.4
- Hiding labels on y axis in Chart.js
- responsive = false not working
- Grouped bar charts with intersecting ticks
- Show bar with zero value in ChartJs v2
- Chart.js Dynamically Updating Chart with X Axis Time
- How change chart height in chart.js
- Changing chart data dynamically with C# from SQL database
- Moving vertical line when hovering over the chart using chart.js in v2.9.4
- Chartjs - Donut Chart label for small values not visible
- Is possible convert an associative array in indexed array in php?
- ChartJS date reformatting for use?