gogessj4
gogessj4

Reputation: 89

How can I manipulate the date shown in the headers of a anychart resource gantt when there is no data to be loaded

We use the anychart GanttResource chart to show Technicians with their tasks on a daily base. To do this we use a DateFilter outside the component to load our data. Then when the data is retrieved from the API we set this data to the chart. As long there is data retrieved there is no problem, the chart fluently goes to the chosen day and only shows this data. However when the API returns no data or a 400, we add an empty list to the chart data. This looks ok at first, but when looking better to it I noticed the chart defaults back to today as date to show in the header. How can I manipulate this so the selected filter date could be shown there? Anyone any suggestions about how to get this result? I can't seem to find a functionality or such to set the timeline date to use.

If my explanation is unclear then please let me know so I can elaborate any further or provide any screenshots to make it more clear.

Upvotes: 1

Views: 66

Answers (1)

AnyChart Support
AnyChart Support

Reputation: 3905

It's not possible to zoom to some period of time when you don't have any data. But you can add an auxiliary element (e.g. a marker) to the data, and you'll be able to set the timeline zoom to a specific range. After you get the real data, the element can be deleted. Please check this sample: https://playground.anychart.com/uZ3gynNU

Upvotes: 1

Related Questions