Home forums Using CanvasJS chart size and annimation in tab setting

This topic contains 1 reply, has 2 voices, and was last updated by  Vishwas R 4 months ago.

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

    dbertanjoli
    Member

    Hello, I would like to display several charts in several tabs but when I do it I lose animation and the sizing is not correct (for example the width doesn’t go 100% as it is set). Any suggestions?
    Many thanks,
    Debbie

    #20360

    Vishwas R
    Keymaster

    Debbie,

    CanvasJS Chart automatically sets the height and width of the chart according to container’s dimensions. If the values are not set for the container, it takes the default values.

    In Bootstrap tabs, since the second tab is not displayed initially, chart takes the default values. To solve this issue, second chart is rendered when the shown.bs.tab event is fired by bootstrap. Please take a look at this jsfiddle.

    In jQuery tabs, you need to render chart when a tab becomes active. Please take a look at jQuery Gallery for an example on the same.

    Still, if you are facing any issue, kindly create jsfiddle with the issue you are facing and share it with us so that we can look into it and understand better to help you out.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.