jettro / c3-angular-directive

Contains angularjs directives that use c3js to create good looking graphs
http://jettro.github.io/c3-angular-directive/
MIT License
203 stars 98 forks source link

call controller / scope function from as valueFormatFunction #155

Open gadeynebram opened 7 years ago

gadeynebram commented 7 years ago

Hi,

Great library!

Is it possible to call a function from your controller or scope as the valueFormatFunction in chart-tooltip?

This does not work:

`

`

or something like this does not either

<chart-tooltip valueFormatFunction="angular.element(document.getElementById('line-chart-{{$index + 1}}')).controller().formatValue(value)"></chart-tooltip>

NitsanBaleli commented 5 years ago

@gadeynebram You need to use it like this:

value-format-function="chartCtrl.formatValue"