0
我想顯示莫里斯線圖,但該行不顯示出來,這樣莫里斯線不工作
這是我的代碼
<div class="panel-body">
<div id="morris_area_operation"></div>
<?php
$operation_quey = DB::table('station_vehicule')
->select('operation_date as date',
DB::raw('COUNT(operation_date) as nombre'))
->where('operation_name', '=', 'Carburant')
->groupBy('operation_date')
->orderBy('operation_date', 'asc')
->get();
?>
<script>
var data_collection = <?php echo json_encode($operation_quey); ?>;
new Morris.Line({
element: 'morris_area_operation',
data: data_collection,
xkey: 'date',
ykeys: 'nombre',
xLabelFormat: function(x) {
return x.toDateString();
},
ymax: 'auto',
hideHover: true,
resize: true
});
</script>
</div>
正如你所看到的,數據存在(日期和數據)但我看不到圖表中的行
help mplease
它適用於我,thx @Matt :) – wael