I am trying to fetch data from MySQL database and display on a column chart using HIghChart but nothing seems to be showing.
This is my view:
<div id="last7days">
</div>
<script type="text/javascript">
$(function () {
//var data_click = 4;
//var data_viewer = 5;
Highcharts.chart('last7days', {
chart: {
type: 'column'
},
title: {
text: 'Last 7 days Transactions'
},
xAxis: {
categories: jdata.date, //['2013','2014','2015', '2016']
},
yAxis: {
title: {
text: 'Amount(in naira)'
}
},
series: [{
name: 'Credit',
data: jdata.credit
},{
name: 'Debit',
data: jdata.debit
}]
});
});
</script>
Find attached, here is the json data being returned by the controller
{"date":["2017-12-20","2017-12-21","2017-12-22"],"credit":["500600.00","2000.00","5600.00"],"debit":["0.00","0.00","47582.00"]}
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kMJyo2
via IFTTT
Aucun commentaire:
Enregistrer un commentaire