I am trying to display data on a line graph using google graphs. The data is displayed well, however I would like to set the date range to be displayed.
Data is sent from the database in literal JSON format:
{ "cols": [ {"label": "Week", "type": "date"}, {"label": "Speed", "type": "number"}, {"type":"string","p":{"role":"tooltip"}}, {"type":"string","p":{"role":"tooltip"}}, {"type":"string","p":{"role":"tooltip"}}, {"type":"string","p":{"role":"tooltip"}}, ], "rows": [ {"c":[{"v": "Date('.$date.')"},{"v": null},{"v": null},{"v": null},{"v": null},{"v": null}]}, {"c":[{"v": "Date('.$date.')"},{"v": null},{"v": null},{"v": null},{"v": null},{"v": null}]} ] }
Data is displayed by week or month ( null for readability), for example, this week:
2012, 02, 06 2012, 02, 07 2012, 02, 09
Data is not set for the daily week, so this example only shows the dates above. What I would like to show is the beginning of the week (2012, 02, 06) until the end of the week (2012, 02, 12), similar to the third example.
I managed to show the whole week by checking if the date exists in the database, and if it does not add an extra row, there will be zero data, this, however, meant that the line was not continuous and the dates when they are not in order.
Can anyone offer any advice on how I can do this?
Thanks!