Home Forums Chart Support How do I center or Left/Right justify a Label

How do I center or Left/Right justify a Label

Viewing 6 posts - 1 through 6 (of 6 total)
  • #28343

    How do I center or Left/Right justify a Label? Is there a way to do this? When a label wraps to more than one line, it defaults to being left justified. It would look much better Centered for vertical bar charts and Right justified for horizontal bar charts. Is there a way to do this? Having labelAlign for AxisX & AxisY seems to be a way to solve this.

    #28344

    To clarify the issue some more — the label I need to right justify is inside DataPoints. The long labels wrap and we need them to be right justified to fit up against the horizontal bars.

    #28345

    data: [{
    type: “bar”,
    dataPoints: [{
    x: 0,
    y: 71,
    label: “test test test test test test test test test test test test test test”
    },
    {
    x: 1,
    y: 55,
    label: “test test test test”
    },
    ]
    }]

    #28353

    @gregs,

    Aligning axis label is not available as of now. We will re-consider this behavior in future releases.


    Vishwas R
    Team CanvasJS

    #28359

    Is there another way to have text (instead of values) for the X-Axis? Label inside the DataPoints is the best way to do this? If so, would paying for priority support possibly get this “label align” feature added? Thanks!

    #28378

    @gregs,

    Is there another way to have text (instead of values) for the X-Axis?

    You can use label to show text in axisX, please refer documentation for more info along with live example.

    Label inside the DataPoints is the best way to do this?

    Axis labels are shown at every interval whereas you can use indexLabel to show text / info regarding a dataPoint.

    would paying for priority support possibly get this “label align” feature added?

    Please contact sales[at]canvasjs[dot]com for more sales related information.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.