I am trying to get charts to fade in without having them bounce in, or come in elastically, etc.
From the docs, it says that elastic is the default animation type. I tried blank, or "none". Those crash amcharts.
See the following fiddle: https://jsfiddle.net/tegnu71s/
var chart = AmCharts.makeChart( "chartdiv", {
"type": "pie",
"theme": "light",
startDuration:"10",
startEffect:"elastic",
startAlpha:0,
"dataProvider": [ {
"country": "Lithuania",
"litres": 501.9
}, {
"country": "Czech Republic",
"litres": 301.9
} ],
"valueField": "litres",
"titleField": "country",
"balloon":{
"fixedPosition":true
},
"export": {
"enabled": true
}
} );
Is this possible, and if so, how?
You have correctly identified the startAlpha parameter. It will make the slices fade in.
Now, to just disable the bounce effect, set startRadius to zero:
var chart = AmCharts.makeChart("chartdiv", {
"type": "pie",
"theme": "light",
"startDuration": 10,
"startRadius": 0,
"startAlpha": 0,
"dataProvider": [{
"country": "Lithuania",
"litres": 501.9
}, {
"country": "Czech Republic",
"litres": 301.9
}],
"valueField": "litres",
"titleField": "country",
"balloon": {
"fixedPosition": true
},
"export": {
"enabled": true
}
});
<script src="//www.amcharts.com/lib/3/amcharts.js"></script>
<script src="//www.amcharts.com/lib/3/pie.js"></script>
<script src="//www.amcharts.com/lib/3/themes/light.js"></script>
<div id="chartdiv" style="width: 100%; height: 250px;"></div>
If you want the slices fade in all at once as opposed to one by one, set sequencedAnimation: true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With