Here is the scenario I am facing:
- My server returns data already in time "buckets". Something like:
{
buckets: [
"timeSpan" : {
"min" : "1900-01-01T00:00-08:00",
"max" : "1909-12-31T23:59:59.999999999-08:00"
},
"count" : 288, //Total count
"seriesData" : [ {} ... {} ] //Objects with individual series counts
]
}
When creating the preloaded data object for the chart, I use the min date of the bucket converted into a long by calling .getTime() of the parsed date object.
Since our server is returning the buckets in a specific time zone, in this case -08:00, the start of the 10 year bucket is not "1900-01-01T00:00:00.000Z", but rather "1900-01-01T08:00:00.000Z"
When using the display units setting to group by "10 y" it uses a start/end time of -2208988800000 ("1900-01-01T00:00:00.000Z") / -1893456000000 ("1910-01-01T00:00:00.000Z")
This means that if I had an event which happened at "1899-12-31T23:00-08:00" ("1900-01-01T07:00:00.000Z") it would fall into a the wrong decade on the chart compared to the timezone of the server.
I was hoping there is a way to supply the start and end times or timezone for the buckets. It seems that setting the data.timeZoneOffset does not change the start/end times of the buckets.
Sorry if that is confusing, please let me know if you have any questions.
As an aside, do you have any pre made templates for Plunker or JSFiddle so we can fork and post examples, or should we just create our own?
Thanks again for all your help.