Home forums Using CanvasJS Add HTML element in axis label

This topic contains 4 replies, has 2 voices, and was last updated by  Vishwas R 9 months, 2 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19795

    I need to show and axis labels as HTML elements, something like this

    IP: 192.168.1.10 <br>
    Location: Mumbai

    is there any way I can do this?

    #19797

    Vishwas R
    Keymaster

    @himanshu_tanwar,

    HTML tags are not supported in labels as of now. Instead, you can use labelMaxWidth property of axisX/axisY to wrap the label once the label-width reaches the specified max-width.

    Please take a look at this jsfiddle.


    Vishwas R
    Team CanvasJS

    #19798

    @vishwas,

    That does not fulfil the requirement, setting the maxWidth does not allow me to break the text at a specific point.
    Moreover I cannot make any specific section of the label to be bold.

    Is there any workaround for this or can HTML labels be supported anytime shortly?

    #19799

    Same is the requirement for legend items

    #19806

    Vishwas R
    Keymaster

    @himanshu_tanwar,

    Sorry, as of now html tags are not supported except in toolTip, take a look at toolTipContent for the same. It’s there in our features wishlist, but there is no definite timeline.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.