Using "fixedColumnWidth"
HTML
<script type="text/javascript" src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script type="text/javascript" src="http://www.amcharts.com/lib/3/serial.js"></script>
<script type="text/javascript" src="http://www.amcharts.com/lib/3/themes/none.js"></script>
<div id="chartdiv" style="display: none;"></div>
CSS
#chartdiv {
width : 100%;
height : 500px;
font-size : 11px;
}
JavaScript
// this will get executed BEFORE chart is drawn
// we'll use it to modify the width of the chart area
AmCharts.addInitHandler(function(chart) {
// total offsets reserved for margins
var offsets = 100;
// pixel value reserved for each category
var categoryWidth = 80;
// calculate width
var width = offsets + chart.dataProvider.length * categoryWidth;
// set container width
document.getElementById("chartdiv").style.width = "" + width + "px";
// since the chart is already build for the initial container size we need to
// revalidate it's size. we'll delay a little bit the call to invalidateSize()
// so that the chart elements are created first
setTimeout(function () {
chart.invalidateSize();
document.getElementById("chartdiv").style.display = "block";
}, 1);
}, ['serial']);
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "none",
"dataProvider": [{
"country": "USA",
"visits": 20250
}, {
"country": "China",
"visits": 18820
}, {
"country": "China",
"visits": 15
}],
"valueAxes": [{
"gridColor":"#FFFFFF",
"gridAlpha": 0.2,
"dashLength": 0
}],
"gridAboveGraphs": true,
"startDuration": 1,
"graphs": [{
"balloonText": "[[category]]: <b>[[value]]</b>",
"fillAlphas": 0.8,
"lineAlpha": 0.2,
"type": "column",
"valueField": "visits"
}],
"chartCursor": {
"categoryBalloonEnabled": false,
"cursorAlpha": 0,
"zoomable": false
},
"categoryField": "country",
"categoryAxis": {
"gridPosition": "start",
"gridAlpha": 0,
"tickPosition":"start",
"tickLength":20
},
"exportConfig":{
"menuTop": 0,
"menuItems": [{
"icon": '/lib/3/images/export.png',
"format": 'png'
}]
}
});