score:2
the reason it's not working is because, you are getting the response data as a json string not json object.
so, to make it work with chartjs, you need to parse it first, using json.parse()
method ...
$(document).ready(function() {
$.ajax({
url: "prod_agg.php",
method: "get",
success: function(data) {
console.log(data);
var data = json.parse(data); //parse json string
var date = [];
var output = [];
...
Source: stackoverflow.com
Related Query
- Bar Graph, chart.js PHP Will Not Load
- Chart.js Bar graph will not start at zero as minimum value
- Chart.js: bar chart first bar and last bar not displaying in full
- Last value not showing in bar graph of charts.js-library
- Chart.js Chart in Angular does not load until resizing browser window
- Chart.js update function (chart,labels,data) will not update the chart
- Chartjs (Non Vue) Not Rendering Graph Chart inside V-if/V-show
- Chart.js Ionic 2 Angular2: Background color of bar graph not changing
- Chart js space above bar graph
- Trying to load a chart with chart.js, through ajax and php
- Grouped Bar Chart from mySQL database using ChartJS and PHP
- Chart.js Date and Time Bar Chart Not Rendering - Line Works Though
- Bar Chart of ChartJS does not Render
- Vertical Bar Chart not displaying Correctly
- chart js chart bar chart not showing data from 0
- Chartkick-vue bar chart - "horizontalBar" is not a registered controller
- Legend not displaying on Line or Bar chart - React-Chartjs-2
- Display Bar chart values in the graph - ChartJS
- Chartjs with Vue, Bar Chart Border Radius not working
- Bar Chart Not Stacking When Using ChartJs
- Alternating bars in bar chart in chart.js are not labelled
- Charts.js - Colors for stacked bar on multi-series line/bar chart are not working
- Why is this bar chart using chart.js not rendering in react.js?
- Charts.js - Bar chart different colors for value intervals not working
- Issue with chartjs linear gradient for the mixed bar chart in ReactJS is not calculated for each individual Bars
- Chartjs Stacked bar chart not displaying correctly
- Dynamic data in bar chart not rendering React js
- Chart.js in Angular 10: Specified colors not shown in multi-series bar chart (instead random colors)
- ChartJS not showing data for time series bar chart
- Vertical align bar chart from chart.js not working
More Query from same tag
- Chartjs animate x-axis displaying data incorrectly in mac device
- Stacked horizontal bar chart along total count with chart.js
- How to fill a graph by a color till a vertical line using chart.js
- ChartJS horizontal label are 1-2px clipped
- How to pass an array to chart.js data:[] while creating a chart in php
- Chart.js only appears randomly, and disappears on page refresh
- yAxis labels are being cut off in ngEchars (Echarts)
- AngularJS Pagination not showing all pages
- Chartjs: customise legend based on background color
- ChartJs - set x-axis ticks at specified/fixed intervals
- ChartJS scale ticks with scatter plot
- Inject html into ng2-chart tooltip to preview image
- AngularJS/ChartJS: Get the current series
- Angular 2 Chart.js and NG2-Charts Not Binding Data Objects After Updates To Project
- Chart.js not displaying Django Rest API data
- Chart.js Bar Chart - grouping and mapping data
- Chartjs for Line chart, values on y-axis
- ChartJs - annotation line can not drawn
- chartjs resizing very quickly (flickering) on mouseover
- Removing chart on click event produces 'removeHoverStyle' of null error
- Price history with chart js
- Unable to make y-axis to begin at zero on Charts.js v2.1.4
- Chart.js - Multiple JSON data object array [{x: Date, y: count}....] representing each dataset of the chart
- Printing chartjs tooltips
- Converting Chart.js canvas chart to image using .toDataUrl() results in blank image
- How to only draw the graph and the Xaxis gridlines using chart.js
- is there anything wrong with this If Condition in Javascript code?
- Change dot size individually Scatter Chart -- ChartJS
- Display all labels in Chart.js
- Chart.js: evenly distribute ticks when using maxTicksLimit