elastic / elastic-charts

https://elastic.github.io/elastic-charts/storybook
Other
370 stars 119 forks source link

Axes labels should wrap their text #313

Open cchaos opened 5 years ago

cchaos commented 5 years ago

Describe the bug If there isn't enough available space, axes labels will get cut off.

To Reproduce Steps to reproduce the behavior:

  1. Create a chart with a long axes label
  2. See error

Expected behavior Usually I'm a fan of just truncating with an ellipsis and then use title attribute to display the full label. The problem with this is that the chart label is too integral to the understanding of the chart to be hiding pieces of information, also I don't think you can add a title attribute to parts of a Canvas or even SVG element.

Therefore, I think the solution is just to allow the text to wrap lines.

Screenshots

Screen Shot 2019-08-14 at 15 25 26 PM

The label should say 6:00 - 6:14

Version (please complete the following information):

Kibana Cross Issues https://github.com/elastic/kibana/issues/20472

nickofthyme commented 4 years ago

This should also include the ability to truncate the label to a given length.