Forum Replies Created by syduck

Viewing 3 posts - 1 through 3 (of 3 total)
  • in reply to: Chart in div hidden #6269

    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",       
    			     },
    
    in reply to: multiple value axes and line chart with different color #6267

    You can create a line chart with different colors using canvasjs, you just create a multi-series graph and each data series can have a different color that you can specify.

    in reply to: Charts aren't full-size until page is refreshed #5273

    pro-tip: if you load the charts when they are display:none, their size will be messed up (if you re-size the window it fixes it). If you have to load the chart when its display:none, you can explicitly add height and width in the init code (although percentage doesn’t work):

    
        var chart = new CanvasJS.Chart("chartContainer",
        {
          height: 550, //in pixels
          width: 600,
          title:{
          text: "Earthquakes - per month"
          },
    
Viewing 3 posts - 1 through 3 (of 3 total)