Passing Json Data From Controller To View For Morris.js Bar Chart |
I am using morris.js bar chart I am a bit confused on how to pass json data to it from my controller function.
My xkey is the days and user data is the count. Code: {"xkey":[[0,0],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8],[9,9],[10,10],[11,11],[12,12],[13,13],[14,14],[15,15],[16,16],[17,17],[18,18],[19,19],[20,20],[21,21],[22,22],[23,23]],"user":{"data":[[2,"1"],[3,"1"]]}} Question how can I get the json data from controller to the view for xkey and ykeys"user data". My controller function PHP Code: public function chart_data() { On my view script Code: <script type="text/javascript">
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Messages In This Thread |
Passing Json Data From Controller To View For Morris.js Bar Chart - by wolfgang1983 - 08-21-2016, 03:35 AM
RE: Passing Json Data From Controller To View For Morris.js Bar Chart - by InsiteFX - 08-21-2016, 04:21 AM
|