Open pankewen opened 7 years ago
Sorry for the format of the code snippet. I uploaded a .txt which is more readable. samplecode.txt
Thanks for this!
I have considered this approach in the past and have always found it a bit too brittle... Relying on whether or not Date.parse
returns NaN
for the first value of a series seems dangerous to me, especially since any number will parse as a date. In addition, Date.parse
has odd behaviour for various commonly-used formats: for example new Date(Date.parse("10-10-19"))
returns "Thu Oct 10 2019 00:00:00 GMT-0400 (EDT)"
whereas new Date(Date.parse("2010-10-19"))
returns "Mon Oct 18 2010 20:00:00 GMT-0400 (EDT)"
.
I wonder if a more flexible approach wouldn't be to accept a function to do this detection, so that developers could "choose their poison", so to speak, if they know they are passing in dates in MM/DD/YY or YYYY-MM-DD format etc.
Regarding the idea of cumulative sums, you may want to check out issue #140 :)
(oh, and as a PS: pasting multi-line blocks of code in Github is usually done surrounded by triple-backticks, to preserve formatting. You can optionally add a language as I did above :)
Dear Nicolas, your work here is just impressive. Thanks a lot, I really like it! :-)
I am using your code but missed a feature: sometimes I have data which containes dates. These could be used in line and area diagrams using timeseries axis. Currently your code is fixed to "category". The disadvantage is that all x ticks are equally distributed.
I extended your c3_renderer.js and want to share it. Perhaps you intend to take it over:
And then, using this a next point come up :-) For timeseries it would be great to have the possibility to show cumulated data. This means the data should sum up from left to right (from oldest date to newest one). I will investigate this a bit. In case I extend it, I will let you know also.
So my question: are planning to proved timeseries support in some future?
Kind regards and have a nice weekend! Chris