我正在使用AngularJS和Angularjs-nvd3-directives来制作一个仪表板。大多数情况下,我使用折线图。如果我能在图表上标记一些事件,那就太好了。假设我有一个时间序列。我想在某个时间点绘制一个标记(一个点或一条线,可能带有自定义的工具提示)。
有没有办法做到这一点?
谢谢你的建议。
发布于 2014-10-16 17:10:53
如果涉及到自定义工具提示,您可以在图表指令中添加一个属性:
tooltipcontent="toolTipContentFunction()"然后,在你的controller中定义一个产生超文本标记语言的函数:
$scope.toolTipContentFunction = function(){
return function(key, x, y, e, graph) {
return '<h1>My Custom Tooltip</h1>' +
'<h3>' + key + '</h3>';
}
};https://stackoverflow.com/questions/26398848
复制相似问题