api to format vertical axis values

I have a timeline that has capacity as its vertical axis. I would like to format the values as ‘1TB, 1MB, etc.’ Currently you can set the vertical grid values, but not the string/unit. Another use case would be to format the values to make the more readable. For example format ‘100000000’ as ‘100,000,000’.

Is there a way to do that at the moment? There is an api to set the vertical axis values, but there doesn’t seem to be a way to register some function to format them.

tx,
Kim

At the moment no.

But if you only want to display the unit in the vertical axis then you can add the following CSS to your theme:


.v-timeline-widget-display-vscale:after,
.v-timeline-widget-display-vscale-drag:after{
     content: " Unit";
}

It will place the unit after each value in the vertical axis.

You can also always file an enhancement ticket at
http://dev.vaadin.com
if you’d like to see such a feature included with the Timeline in the future.

Hi,

That helps a little bit, but it doesn’t allow me to format the values like in the attached screenshot. I’ll enter an enhancement request.

Kim
12351.png