Custom item placer with equidistant ticks #1004
-
QuestionQuestion Hi, my question is similar to this other one #970 I am looking to place ticks on the horizontal axis to depict days of the month. I would like to use a getXStep of 5 so ticks are only placed every 5 days (5th, 10th) etc but possibly also override the first and last ticks ![]() The issue I have is with the first tick which then needs to be zero as seen in the image. Is there any way to get the graph to show the days correctly? This would mean 1,5,10 etc on the x axis I have tried:
Is there anyway to do this and just have the progression of (1,5,10, etc)? Module(s)compose-m3 Platform(s)Android Platform version(s)No response Vico version(s)2.0.1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello, @emkayDauda.
Yes, it’s possible. You can do this by creating a A complete implementation isn’t necessary — you can delegate most of the logic to a default one and only make the required adjustments. |
Beta Was this translation helpful? Give feedback.
Hello, @emkayDauda.
Yes, it’s possible. You can do this by creating a
HorizontalAxis.ItemPlacer
implementation and overridinggetLabelValues
accordingly. The default placers produce a customizable but constant x step. Please note that this is covered in the documentation, with exact formulas provided.A complete implementation isn’t necessary — you can delegate most of the logic to a default one and only make the required adjustments.