作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试让图表淡入而不让它们反弹或弹性进入等。
从文档中可以看出,elastic 是默认的动画类型。我试过空白,或“无”。那些崩溃的图表。
请参阅以下 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
关于javascript - 在 amcharts 中淡入淡出(没有 startEffect 的 startAlpha),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36163718/
我是一名优秀的程序员,十分优秀!