我正在使用angularjs-nvd3-directives创建一些饼图和堆叠条形图,并想知道如何更改转换持续时间甚至类型,但持续时间是我主要希望调整的。
下面是我的代码:
<nvd3-multi-bar-horizontal-chart
data="stackedData"
id="stackedExample2"
showvalues="true"
valueformat="valueFormatFunction()"
showlegend="true"
tooltips="true"
showlabels="true"
stacked="true"
color="colourFunction()"
legendcolor="colourFunction()"
showxaxis="true"
showyaxis="true"
x="xFunctionBar()"
showcontrols="false"
interactive="true"
margin="{left:100}"
transitionduration="1000">
<svg></svg>
</nvd3-multi-bar-horizontal-chart>transitionduration只影响图形的初始负载,但是当数据更改并重新绘制图表时,条形图或饼图切片转换为新值的速度太快。我希望能够放慢速度,如果可能的话,改变过渡类型。它目前默认从左上角到右下角转换-这对于缓慢的图表加载是很好的,但转换看起来很糟糕。
我尝试过delay="500",但它似乎没有任何作用。我是不是漏掉了什么?
发布于 2015-02-28 21:11:48
从DOM中选择它并添加持续时间会起作用吗?
d3.select("#chart").duration(300);发布于 2016-04-22 14:38:30
有一个名为“duration”的属性。
$scope.options = {
chart: {
type: 'multiBarHorizontalChart',
height: 450,
x: function(d){return d.label;},
y: function(d){return d.value;},
showControls: true,
showValues: true,
duration: 500,
xAxis: {
showMaxMin: false
},
yAxis: {
axisLabel: 'Values',
tickFormat: function(d){
return d3.format(',.2f')(d);
}
}
}
};在options对象中,提供duration对象。这应该行得通。请看一下plnkr。
如果你有什么问题,一定要告诉我。
https://stackoverflow.com/questions/28751703
复制相似问题