maxatthemax
Posts: 5
Joined: Wed Jul 07, 2021 5:13 pm

Dual datetime on horizontal axis at top of the chart breaks when adding data

When the data is hard coded, the dual date at the top of the chart looks fine
Screenshot 2021-07-07 at 18.36.59.png
Screenshot 2021-07-07 at 18.36.59.png (45.08 KiB) Viewed 2312 times
however, when adding the data from vuex

Code: Select all

this.chartOptions.series[0].data = this.$store.getters["get/getProjects"];
,
the top bar of the dual date disappears. The bottom bar is still there but doesnt make much sense when its showing me the week day but not the week
Screenshot 2021-07-07 at 18.38.34.png
Screenshot 2021-07-07 at 18.38.34.png (31.13 KiB) Viewed 2312 times
Any help would be much appreciated, please let me know if you need more information

Max
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Dual datetime on horizontal axis at top of the chart breaks when adding data

Hi! Could you reproduce the issue in online editor? Everything seems to be working fine on my machine. You can start here: https://jsfiddle.net/gh/get/library/pur ... -indicator Kind regards,
Paweł Lysy
Highcharts Developer
maxatthemax
Posts: 5
Joined: Wed Jul 07, 2021 5:13 pm

Re: Dual datetime on horizontal axis at top of the chart breaks when adding data

After trying to recreate it, I found that it happens when the data is added after a delay, whether its from an api call or a timeout.

Here it is recreated: https://codesandbox.io/embed/highcharts ... theme=dark

After the 2 second delay, the data is added but one of the dual dates disappear
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Dual datetime on horizontal axis at top of the chart breaks when adding data

Hi! It looks like you didn't define multiple xAxes, and when you added the data, one of those was overwritten by data. Check the following example, and let me know, if that works for you! Kind regards,
https://codesandbox.io/s/highcharts-vue ... rked-93iwe
Paweł Lysy
Highcharts Developer
maxatthemax
Posts: 5
Joined: Wed Jul 07, 2021 5:13 pm

Re: Dual datetime on horizontal axis at top of the chart breaks when adding data

Yes! After defining the 2 x-axis, it stopped getting overwritten. Thank you for the help
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Dual datetime on horizontal axis at top of the chart breaks when adding data

Good to hear! In case of any further questions feel free to contact us again! Kind regards,
Paweł Lysy
Highcharts Developer

Return to “Highcharts Gantt”