0

I'm using AngularJS and Angularjs-nvd3-directives to make a dashboard. Mostly, I'm using line charts. It would be nice if I could mark some events on the chart. Let's say that I have a time series. I would like to draw a marker (a dot or a line, maybe with a custom tooltip) at some point in time.

Is there any way to do that?

Thanks in advice.

Markotron
  • 50
  • 8

1 Answers1

0

If it comes to custom tooltips you can add an attribute to your chart directive:

tooltipcontent="toolTipContentFunction()"

and then, in your controller define a function which produces the HTML:

$scope.toolTipContentFunction = function(){
return function(key, x, y, e, graph) {
    return  '<h1>My Custom Tooltip</h1>' +
            '<h3>' + key + '</h3>';
    }
};
Kamil R
  • 447
  • 5
  • 11
  • Hi Kamil, tnx for your reply. I get the tooltip, but do you maybe know how can I draw single points on my line chart? – Markotron Oct 16 '14 at 14:47
  • Well, I haven't done that, but looking at some other posts, it should be possible with CSSes. See [link1](http://stackoverflow.com/questions/18530459/nvd3-js-bigger-points-in-a-line-chart), [link2](http://stackoverflow.com/questions/13732971/is-an-nvd3-line-plot-with-markers-possible). Hope that will help. – Kamil R Oct 17 '14 at 12:53
  • Well, after trying and trying I switched to highcharts. The library is amazing. Anyways, thnx for help. – Markotron Oct 20 '14 at 08:57