Sets the Chart Width to any given value in Pixels
var chart = new CanvasJS.Chart("container", { . . width: 320, . . }); chart.render();
Also See:
Comments 18
Server Side Technologies |
Front End Technologies |
Contact |
|
---|---|---|---|
ASP.NET MVC Charts | JavaScript Charts | FAQs | |
PHP Charts | jQuery Charts | Sales Enquiries | |
Spring MVC Charts | React Charts | Support Forum | |
JSP Charts | Angular Charts | Careers | |
JavaScript StockCharts | |||
Privacy Policy © fenopix
Due to multiple records few of records(columns) get hide in left section of graph and right section of the graph.
Rajesh,
Can you please create a jsfiddle and post it into our forum so that we can have a look?.
i had created two charts in one page but it shows only once in one time. How can i show both chart in one page at one time.
Jayant,
Please refer this example.
In the above Anjali’s example can we add a padding before each x axis values?
how to reduce the bar width in above example
As of now it is not possible to reduce/set width of individual bars. They are decided automatically based on the number of dataPoints.
Example for horizontal bar.
1. you need to define the height of single bar, and calculate all bar height.
such as
var _height = arr.length * 50; // 50 means bar height
2. to define height of the html body.
ex.
$(‘#chartContainer’).attr(‘style’,”height: “+ _height+”px; width: 100%;”);
3. set the parameter ‘height’ with CanvasJS.Chart
ex.
var chart = new CanvasJS.Chart(“chartContainer”,
{
title:{text: chart_title },
height : _height,
…
}
try it :D
I have increased my column graph width but for last bars tool tip is not visible . ie it will not be displayed after some width.
madhu,
Can you please create a jsfiddle so that we can have a look ?
Hi, this is my http://jsfiddle.net/jpgrnow1/2/ I created a bar char but en my xaxis hide the name, whe I resize my browser they appers. I want to show always the xaxis name
mauricio,
When you have more number of columns then chart automatically skips some of the labels to avoid overlapping. But you can force it to show all labels by setting interval property of axisX to 1.
its possible to add 100% for width..
Currently only pixel value can be set to width, we will support percent value in our future version.
Manimaran,
Charts take up 100% of the width of its container by default if you don’t set any value.
Hello Do we have any property to decided bar size??
Tejas,
You can use dataPointWidth to set the width of column or bar.
Hi All, How I can increase the grid width of chartcontainer?