在 amcharts 中淡入淡出(没有 startEffect 的 startAlpha)
Fading in amcharts (startAlpha without startEffect)
我正在尝试让图表淡入而不让它们反弹或弹性进入等。
从文档中可以看出,elastic 是默认的动画类型。我试过空白,或 "none"。那些崩溃的 amcharts。
见下文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
}
} );
这可能吗?如果可能,怎么做?
您已正确识别 startAlpha
参数。它将使切片淡入。
现在,要禁用反弹效果,请将 startRadius
设置为零:
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>
如果您希望切片全部淡入淡出而不是一个接一个淡入淡出,请设置 sequencedAnimation: true
我正在尝试让图表淡入而不让它们反弹或弹性进入等。
从文档中可以看出,elastic 是默认的动画类型。我试过空白,或 "none"。那些崩溃的 amcharts。
见下文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
}
} );
这可能吗?如果可能,怎么做?
您已正确识别 startAlpha
参数。它将使切片淡入。
现在,要禁用反弹效果,请将 startRadius
设置为零:
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>
如果您希望切片全部淡入淡出而不是一个接一个淡入淡出,请设置 sequencedAnimation: true