【发布时间】:2016-05-18 05:30:25
【问题描述】:
我在我的网站上使用 angular-nvd3 的堆积面积图。在图形工具提示上,除了数据点之外,所有点的总和也被渲染。 如何禁用它? 我正在附上我设置的快照和图表选项。
$scope.graphOptions = {
chart: {
type: 'stackedAreaChart',
height: 300,
margin: {
top: 20,
bottom: 30,
left: 40
},
useVoronoi: false,
clipEdge: true,
duration: 10,
showLegend:false,
useInteractiveGuideline: true,
x: function(d){return d[0];},
y: function(d){return d[1];},
xAxis:{
//mode: 'time'
timeformat: '',
showMaxMin: false,
position: 'bottom',
tickFormat: function(d) {
return d3.time.format('%b %d')(new Date(d))
}
},
yAxis: {
tickFormat: function (val) {
if (val > 1000000000)
return Math.round(val / 1000000000) + 'Bil';
else if (val > 1000000)
return Math.round(val / 1000000) + 'Mil';
else if (val > 1000)
return Math.round(val / 1000) + 'K';
else
return Math.round(100 * val) / 100;
}
},
showControls: false
}
}
};
【问题讨论】:
-
最近在另一个问题中针对不同类型的图表回答了这个问题,但您可以使用
$scope.graphOptions.chart.tooltip.contentGenerator方法自定义工具提示。希望这能让你到达你需要去的地方,但如果没有,如果你设置一个显示问题的 plunker,我可以进一步帮助你。 -
非常感谢...解决了我的问题
标签: angularjs tooltip angular-nvd3