Home forums Using CanvasJS toolTipContent Width

This topic contains 1 reply, has 2 voices, and was last updated by  Indranil Deo 10 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #19167

    msiv
    Participant

    Hi.

    I have a question regarding toolTipContent of a dataseries. Is it possible to apply a style to manage the text overflow? I need to limit the width of the tooltip when the text is huge but every thing I tried failed.

    The following code limits the width of the tooltip and it works but the text always overflows the div.
    toolTipContent: '<div style="width:200px;overflow-wrap:break-word;">This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.</div>

    I tried to set other CSS properties like text-overflow, word-break and word-wrap but the text still overflows the div.

    Do you have an idea how to fix that?

    #19198

    Indranil Deo
    Member

    @msiv,

    Adding CSS property white-space: pre-wrap to the div in toolTipContent will work fine in your case. Please take a look at this jsfiddle.

    ___________
    Indranil Deo,
    Team CanvasJS

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

You must be logged in to reply to this topic.