var chart = AmCharts.makeChart("chartdiv", {
"theme": "light",
"type": "serial",
"startDuration": 2,
"dataProvider": [{
"food": "Red Seedless Grapes",
"sugars": 20,
"color": "#0000AA"
}, {
"food": "Navel Orange",
"sugars": 23,
"color": "#0000AA"
}, {
"food": "Apple",
"sugars": 23,
"color": "#0000AA"
},{
"food": "Watermelon",
"sugars": 18,
"color": "#0000AA"
}, {
"food": "Snickers",
"sugars": 18,
"color": "#5500AA"
}, {
"food": "Chips Ahoy",
"sugars": 11,
"color": "#5500AA"
}, {
"food": "Oreos",
"sugars": 14,
"color": "#5500AA"
}, {
"food": "Fruit Roll-Ups",
"sugars": 7,
"color": "#5500AA"
}],
"valueAxes": [{
"position": "left",
"axisAlpha":0,
"gridAlpha":0
}],
"graphs": [{
"balloonText": "[[category]]: <b>[[value]]g</b>",
"colorField": "color",
"fillAlphas": 0.85,
"lineAlpha": 0.1,
"type": "column",
"topRadius":1,
"valueField": "sugars"
}],
"depth3D": 40,
"angle": 30,
"chartCursor": {
"categoryBalloonEnabled": false,
"cursorAlpha": 0,
"zoomable": false
},
"categoryField": "food",
"categoryAxis": {
"gridPosition": "start",
"axisAlpha":0,
"gridAlpha":0
},
"export": {
"enabled": true
}
},0);
jQuery('.chart-input').off().on('input change',function() {
var property = jQuery(this).data('property');
var target = chart;
chart.startDuration = 0;
if ( property == 'topRadius') {
target = chart.graphs[0];
}
target[property] = this.value;
chart.validateNow();
});
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .