I am using a library to generate timeline charts. In some knocks, I add a series of dots with voids to the scale. For example, I attach a screenshot.
The screenshot shows that there are points for the time intervals from 6:30 PM to 23:59 PM. And the rest of the time is empty, there are no points for this time. I need the x-axis to exclude these points from its surface.
To form the axis, I use
this.chart
.getDefaultAxisX()
.setTickStrategy(
AxisTickStrategies.DateTime,
(tickStrategy: DateTimeTickStrategy) => tickStrategy
.setDateOrigin(this.originDate)
);
Unfortunately, in the documentation, I have not yet found an opportunity to specify any flag like (tickStrategy: DateTimeTickStrategy) => tickStrategy.eliminateVoids()
As a way out, I see one solution so far. Do not use the standard axis sweep strategy, but make your own custom one. .addCustomTick(UIElementBuilders.AxisTick) This is how to add custom ticks, and try to specify labels for each point on the axis yourself. But it looks like hard labor, is there an easier solution?
P.S. My question is most likely similar to something like this -> R: Way to Remove Names on X Axis That Were Not Plotted (Leaving Names That Were)?
In LightningChart JS v.3.2 there is indeed no features for managing gaps in data (in rendering or on axis ticks), as you have found out.
The existing automatic tick placement logic has very little modification logic for the placement of ticks for simplicity. I believe the first official solution to this problem case would have to be support for specifying gaps in data which would reflect in both rendering and axis ticks placement. However, this is not an actively prioritized issue for us, unfortunately.
We do, however, have an example on managing ticks manually in a scrolling application. Please find it here. This is indeed extra labor, but at least it should be much easier with a reference code available.