Home Forums Chart Support alignment of multiline label

alignment of multiline label

Viewing 4 posts - 1 through 4 (of 4 total)
  • #35784

    Hello,
    I have created a horizontal bar chart with some multiline labels and I cannot get to align the mulit-line labels nicely.

    My “X” axis is on the left and my problems are:
    – labelTextAlign: “left” is ignored on the X axis
    – vertical alignment of multiline labels is not centered (the label starts in the center, but is not aligned on the center)

    My problem is with the 1st and the 3rd label in the following example.
    https://jsfiddle.net/ghrnmypq/

    Increasing the maximum label width is not an option as I will have several charts side by side.

    Can somebody help my to understand what I did wrong ?

    #35799

    @marcel-frey,

    Setting labelTextAlign property allows you to align the text within particular label to left / center / right according to the line that has maximum width out of all the lines that are wrapped. In your example, label ‘Function Management’ and ‘Accounts Receivables’ is getting wrapped once its width crosses labelMaxWidth. Please take a look at this updated JSFiddle which highlights the region according to which axis labels are aligned to make it more clear about this use-case.

    aligning-axisX-label-to-left


    Ranjitha R
    Team CanvasJS

    #35855

    @ranjita-r

    Thank you for the explanation

    I was looking for a way to align all the labels, not to align the text “within” a label. But I understand that there is not setting for that.

    Kind regards,

    Marcel

    #35857

    Marcel,

    Sorry, it’s not possible to align all axis labels to the left extreme of the chart as of now.


    Ranjitha R
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.