Skip to content

Autorotate x axis tick texts on types "category" and "timeseries" #1236

Closed
@michkami

Description

Description

I would like to have an option for autorotating x axis tick texts on type "category" if there isn't enough space to fit them between 2 ticks.
Main reason for autorotating x axis tick texts is saving unused space in the chart.

It should autorotate if:

  1. axis_x_tick_multiline === false
  2. axis_x_tick_autorotate === true
  3. axis_x_tick_rotate !== 0
  4. longest text width > space between 2 ticks
  5. Check 1-4 on resize/redraw

It also improves the appereance of the x axis if:

  • the texts are too long and there is less space between 2 ticks or
  • there are many elements on x axis

Examples:

  1. There is enough space so the texts aren't rotated:
    1  not rotated

  2. There is not enough space so the texts are rotated:
    2  rotated

  3. There is not enough space for 1 text so all texts are rotated:
    3  rotated long prefix

  4. There are many elements on x axis:
    4  many elements

Would this feature be useful enough to implement it in billboard or perhaps as a plugin?
If needed, this feature could be expanded and implemented for other axis types in the future.

What do you think about it?

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions