Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Word Wrap within an Axis Label
posted

I have a candlestick chart with a categorical x-axis.  The labels for this access are long and I would like the text to wrap to multiple lines.  Right now, the charts display what is can and then ellipses for the rest of the text.  This does not word when several of the categories begin with the same word.

Parents Reply
  • 10685
    Suggested Answer
    Offline posted in reply to Chad McKee

    Hello Chad,

    Thank you for the code attachment.

    Apart from using wrapText function, I had no trouble setting labelExtend: 180, which seems enough for the labels to fit. However, because of the labelAngle used, the first one is trimmed at the beginning (not visible in the canvas). This is why I suggest using labelAngle: -90, for example, in order to align the text vertically. When the labels are too long and the candles are close enough, it really makes sense to use vertical labels, when the requirement is to visualize the whole label.  

    In case you would prefer to stick with the -45 degrees labelAngle, I suggest adding labelExtend for the Y-axis as well, so the first X-axis label is formatted well and visible. I have used labelExtend: 100 and it seems the min required with this length of labels. 

    Other Options:
    Of course the labels
    interval could be increased, so not all labels are visible and yet I don’t believe it could be considered user friendly in most cases. If the data is however predictable and the user could easily recognize what the candles are for (opened/closed values etc.), setting different than interval: 1, is an option.  

    I am attaching the modified sample for reference.

    igDataChart_Wraping of Label.zip
Children