| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
When unit is 'hour', a wrong time series will be generated (A gap between Jan 08 and 15): Array (60)
0 {t: "Mon Jan 08 1990 09:30:00 GMT+0800", y: "27.80"}
1 {t: "Mon Jan 08 1990 10:00:00 GMT+0800", y: "28.69"}
2 {t: "Mon Jan 08 1990 11:00:00 GMT+0800", y: "30.47"}
3 {t: "Mon Jan 08 1990 12:00:00 GMT+0800", y: "30.50"}
4 {t: "Mon Jan 08 1990 13:00:00 GMT+0800", y: "31.12"}
5 {t: "Mon Jan 08 1990 14:00:00 GMT+0800", y: "28.83"}
6 {t: "Mon Jan 08 1990 15:00:00 GMT+0800", y: "29.58"}
7 {t: "Mon Jan 08 1990 16:00:00 GMT+0800", y: "30.39"}
8 {t: "Mon Jan 15 1990 09:30:00 GMT+0800", y: "30.07"}
9 {t: "Mon Jan 15 1990 10:00:00 GMT+0800", y: "31.86"}
...
|
Sorry, something went wrong.
|
Thanks for catching that @nagix. I've pushed a fix |
Sorry, something went wrong.
|
The array starts from Jan 2. I think the time between 0:00 and 9:30 needs to be skipped to 9:30 on the same day. Array (60)
0 {t: "Tue Jan 02 1990 09:30:00 GMT+0800", y: "30.51"}
1 {t: "Tue Jan 02 1990 10:00:00 GMT+0800", y: "30.10"}
2 {t: "Tue Jan 02 1990 11:00:00 GMT+0800", y: "27.88"}
3 {t: "Tue Jan 02 1990 12:00:00 GMT+0800", y: "27.72"}
4 {t: "Tue Jan 02 1990 13:00:00 GMT+0800", y: "27.91"}
5 {t: "Tue Jan 02 1990 14:00:00 GMT+0800", y: "28.04"}
6 {t: "Tue Jan 02 1990 15:00:00 GMT+0800", y: "27.72"}
7 {t: "Tue Jan 02 1990 16:00:00 GMT+0800", y: "27.56"}
8 {t: "Wed Jan 03 1990 09:30:00 GMT+0800", y: "26.93"}
9 {t: "Wed Jan 03 1990 10:00:00 GMT+0800", y: "27.69"}
...
|
Sorry, something went wrong.
|
Thanks. Updated |
Sorry, something went wrong.
There was a problem hiding this comment.
It is still incorrect when unit is 'day' (see Jan 6 and 7).
Array (60)
0 {t: "Mon Jan 01 1990 00:00:00 GMT+0800", y: "28.81"}
1 {t: "Tue Jan 02 1990 00:00:00 GMT+0800", y: "28.93"}
2 {t: "Wed Jan 03 1990 00:00:00 GMT+0800", y: "28.67"}
3 {t: "Thu Jan 04 1990 00:00:00 GMT+0800", y: "27.43"}
4 {t: "Fri Jan 05 1990 00:00:00 GMT+0800", y: "27.28"}
5 {t: "Sat Jan 06 1990 00:00:00 GMT+0800", y: "27.17"}
6 {t: "Sun Jan 07 1990 00:00:00 GMT+0800", y: "28.99"}
7 {t: "Mon Jan 08 1990 00:00:00 GMT+0800", y: "30.38"}
8 {t: "Tue Jan 09 1990 00:00:00 GMT+0800", y: "30.35"}
9 {t: "Wed Jan 10 1990 00:00:00 GMT+0800", y: "30.27"}
...
Sorry, something went wrong.
|
Yikes. I should have had a coffee yesterday. Thanks for the thorough testing. I've updated it as suggested |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
Do we really want to keep that sample in the core repository since now we have the chartjs-chart-financial project? Or maybe we should rename it for something more generic. |
Sorry, something went wrong.
|
On https://www.chartjs.org/samples/latest/ the link says "Time Series". I'm fine to rename the file to be timeseries.html instead of financial.html. I'd like to keep this sample in this repo though because I think it's nice to have a realistic time series chart as a sample and this is currently our only time series sample. |
Sorry, something went wrong.
|
+1 for timeseries.html. My comment was more about not confusing the user who may think that there is no official solution to handle financial charts. I did the same for the datalabels plugin, i.e. removed the associated example since we got many support tickets about user custom implementation. |
Sorry, something went wrong.
|
The other thing we could do is place a note on the sample like:
If we add the note, I wonder if we'd still want to rename? The thing I like about the current file name is that it gives us a way to introduce additional time series samples. If it were named timeseries.html then it might be confusing to differentiate the samples. The note might better address the potential user confusion |
Sorry, something went wrong.
|
I like it |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
I noticed while manually testing autoskip improvements that the financial sample is skipping 1993 and 1994 when unit is set to year because my code for generating sample dates was not too accurate.