So I'm trying to make a bar chart, with morris.js, using CakePHP 3. I have the following nested JSON,(wich contains date details):
MarketingSales:
0: Object
country_id: 5
date: Object
NumeroDia: 4
date: "2015-01-01 T 00:00:00+0000"
day: 1
id: 366
month: 1
week: 1
year: 2015
date_id: 366
id: 4106
medium_id: 8
sales: 54189.18863
views: 3496
This JSON comes from two joined tables ("MarketingSales" and "Dates"), using the "contains" option from CakePHP.
I'm now trying to label the x axis with the number of the month, but I'm getting "undefined" labels.
so far, I have tried:
xkey:['dates']
xkey:['dates.month']
xkey:['dates']['month']
xkey:dates.month
Reading through morris.js documentation I found about setting parseTime to false, but it doesn't work either.
Any ideas of what I'm doing wrong?
Thanks!
Aucun commentaire:
Enregistrer un commentaire