score:0
in your php code
$res1 = $sqlstmt->fetchall();
$res2 = $sqlstmt2->fetchall(); // assuming u have executed 2nd query.
$res['income'] = $res1;
$res['outcome'] = $res2;
echo json_encode($res);
your ajax success
success:function(res){
$incomedata = res['income'];
$outcomedata = res['outcome'];
}
Source: stackoverflow.com
Related Query
- Sending 2 fetched result into AJAX
- Returning fetched JSON correctly but can't get it into Chart.JS
- Query result into array in Laravel 6
- How to run Chart.js samples using source code
- How to add labels into Chart.js canvas plugin?
- Draw a Chart.js with ajax data and responsive. A few problems and questions
- Convert FirestoreCollection into an array?
- Chart.js turn labels into links
- React ChartJS prevent new data from being added into state after it's redrawn?
- How to feed hour and minute data into chartJS
- Is it possible to combine two Y axes into a single tooltip with ChartJS 2?
- How do I import a csv into chart.js?
- Is there a JavaScript Method/ Function to loop Objects via Keys into a array?
- Loading an external JSON into ChartJs
- Parsing JSON data into Chart.js bar chart
- How put dataset labels into multiTooltipTemplate?
- Extend bar chart on Chart JS 2 into a new type of Chart
- How to import Chart.js chartjs-plugin-datalabels npm package into an Angular 7 project
- Chartjs - Insert additional data into chart tooltip
- ChartJs php array into 'labels' and 'datasets'
- How to add ChartJS code in Html2Pdf to view image
- Vue.js component for Chart.js - strange issue on AJAX reload
- Importing data from Model into a View gives me an error I cannot solve
- Chart.js - How to push a collection of array into dataset
- update chart data called through ajax via PHP, MySQL
- Redraw Chart.js Chart with Json_encoded array from ajax request
- Trying to load a chart with chart.js, through ajax and php
- ChartJS - Adding legend title into tooltip title
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- Beginner using chart.js: having trouble display state full of data into a column chart using variables
More Query from same tag
- not able to move my range slector
- How to increase space between chart and legend? (googlecharts)
- chart.js reduce file size
- How to remove the coloured rectangle(dataset label) in chartJS
- How to export report as PDF/CSV in ChartNew.js
- Chart.js in a Vue page throws error: do not mutate vuex store state outside mutation handlers
- Using Chart.js in Web Worker
- Getting a Chart is not defined ReferenceError with in React + React-chartjs
- chart.js v 2.0.1 line, scatter chart pointRadius bug or I'm doing it wrong
- Add labels to bar chart: chartjs
- Chartjs: dynamic data (array) not working
- How do I customize y-axis labels on a Chart.js line chart?
- Chart.js with 2 y-axis
- Chart.js - hide / remove label on second dataset
- ChartJS: create linear x-axis on bar chart
- Hide the element text on line charts since it overlaps with the line
- How to get ChartJs object from dynamically created chart
- using dynamic array in chartJs for label and data
- Cannot zoom in Chart.js
- Chart.JS not working in Xpages, chart not defined errror
- Javascript How to give color using conditional statement based on json array state value
- Implement a cash flow timeline
- javascript chart.js remove last point
- The 3rd dataset not showing in canvas
- Drawing pie segment percentage in middle of doughnut with chartjs issue
- chart.js how do we extract clicked var?
- Chart.js label and point getting cutoff on the right
- Custom text in tooltip and legend: ChartJs
- ChartJS: Is it possible to omit last grid line to save space
- Chart.js tooltip not showing on line chart