Home forums Using CanvasJS Chart in div hidden

This topic contains 4 replies, has 4 voices, and was last updated by  Sunil Urs 2 years, 6 months ago.

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

    anty
    Participant

    Hi,

    I have a problem when I load canvasjs in div which is hidden.

    The default width no take 100% of my hidden tab, is only take the right width when the tab is open.

    Another method can be resize manually the chart on window resize event, but I don’t know if it is possible to do that ?

    Thanks.

    (Sorry for my english)

    #5508

    Sunil Urs
    Keymaster

    Anty,

    As discussed over chat, I’ll consider implementing this feature in the next version. Will update you on the same once it is implemented.


    Sunil

    #5653

    Niftee
    Participant

    Hi Sunil,

    Is there any update on when the next version with this fix will be released?

    Thanks for your work!

    #6269

    syduck
    Participant

    you can specify the height and width of the graph in the code, that way when the graph renders in a hidden div it will have the proper height and width. You can only specify in pixels though and not percent.

    
    		    	 {
    				  height: 550, //in pixels
    				  width: 600,
    			      zoomEnabled: true,      
    			      colorSet:  "colorSet",
    			      title:{
    			       fontSize: 30,
    			       text: "Activity",       
    			     },
    
    #6274

    Sunil Urs
    Keymaster

    Since v1.4 you can also call render method once it becomes visible and chart updates its size according to its container element.


    Sunil Urs

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

You must be logged in to reply to this topic.