Open creage opened 2 years ago
Hi @creage, tick.culling
option controls the visibility simply by applying display
property.
Having this in mind, if you need to make some specific placed ticks (in this case, first & last), you can do by adding some simple css rule.
.bb-axis-x .tick:first-of-type text,
.bb-axis-x .tick:last-of-type text {
display: inherit !important;
}
@netil Well, sure I can do that, but I'm sure this is something that has to be done by the library, not by me trying to hack the default behavior.
It can't be provided everything as options, because the needs aren't same. The benefit of being svg shines, because literally every elements can be customized even isn't provided as an official option.
I think the option of keeping the first and last ticks visible when applying the max
(or just always doing it without adding an option) would be a nice feature, as this makes the chart easier to understand.
Description
We are using Spline widget with
timeseries
to display some data within a date range. We are also usingculling: { max: 5 }
to limit the amount of labels to display.The issue is that a logic behind deciding which label to show is a bit broken. We'd like to have first and last labels to be always visible, and the rest computed based on the
max
value ( 5 - 2 = 3 more to display).Currently it picks first 5 items from the beginning, hiding the last tick explicitly by
display: none
:What we need is to make first (
0
) and the last tick (25
) visible, as it is important to see the beginning and the end of the range.Steps to check or reproduce