Possible to show axes labels at specific X-values outside of standard interval? #888
-
QuestionHi there, Is it currently possible to draw axes labels, possibly including the guideline, at specific X-values outside the standard interval provided? This seems to be a common use-case that I'm not sure is possible in Vico. For example, instead of just: Thanks! Vico version(s)2.0.0-alpha.27 UI framework(s)Jetpack Compose |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, @Tyler-Lopez. Yes, this is possible. The default selection of label values is produced by To achieve the result you're looking for, you'll need a simple custom implementation. You can delegate to |
Beta Was this translation helpful? Give feedback.
Hello, @Tyler-Lopez. Yes, this is possible. The default selection of label values is produced by
HorizontalAxis.ItemPlacer.default
. This function has parameters for spacing (which also depends on the value returned bygetXStep
) and offset.To achieve the result you're looking for, you'll need a simple custom implementation. You can delegate to
HorizontalAxis.ItemPlacer.default()
and just overridegetLabelValues
so that it adds 80 to the list returned bysuper.getLabelValues
.