Vaadin Charts: Column Chart xAxis Label formating

I have two questions really -

  1. How do I make the xAxis labels (categories) wrap to multiple lines to save space (especially when I have many column bars and rotate the label 90 Degrees) ?

For example, instead of displaying
United States of America

I want to display
Uniteds States
of America

OR
United
States
of America

  1. How do I make the charts xAxis labels clickable like Highcharts does in one of their demos ?

Hi Guru,

  1. Unfortunately you can’t wrap the labels automatically, but you can set the label to be interpreted as HTML and use
    tags to introduce line breaks. See the Labels.setUseHTML(boolean) method.

  2. Are you talking about
    column drilldown
    or something else? Could you please enlighten me about your use-case?

Cheers,
/Jonatan

About the axis labels, I have good news. Vaadin Charts 2.1 has a more flexible way of defining axis label rotation offering the following alternatives to the existing ones:

  • setAutoRotation(Number… autoRotation) : that receives the allowed degrees of label rotation to prevent overlapping labels
  • disableAutoRotation(): that will disable autorotation and will word-wrap the label content if possible

Unluckily it’s not possible to define rotation and word-wrap at the same time.