TargetProcess/tauCharts

Date Format issue

Opened this issue · 4 comments

I'm having trouble getting the date formatting to to work in the latest version of Taucharts. Here is my configuration:
{ "type": "stacked-bar", "x": "date", "y": "activites", "color": "activityGroup", "guide": { "x": { "autoScale": true, "nice": true, "tickFormat": "%d-%b-%y" } } }

Here is my data:
[{ "activityGroup": "Growth Personal", "activites": 1, "value": 2, "date": "2018-08-02 21:29:14" }, { "activityGroup": "Growth Personal", "activites": 2, "value": 4, "date": "2018-08-02 21:29:14" }]

I get the following error:
image

Taucharts does not attempt to detect the type of data. You need to cast string to date type explicitly for date field.
It should be something like this:

const data = [{ "activityGroup": "Growth Personal", "activites": 1, "value": 2, "date": new  Date("2018-08-02 21:29:14")}]

Thank you, that solved my issue with the Javascript error.

@patterson. It is strange. I need some time for investigate this issue. Could you try to make https://jsfiddle.net/taucharts/c5806yeg/33/
I just remove time from Day and convert it to string.
Some docs which can be useful
https://api.taucharts.com/datasource/#time-based-dimensions
https://api.taucharts.com/basic/guide.html#tickperiod

I was able to fix it by adding a tickPeriod to the guide.