c3-angular-directive icon indicating copy to clipboard operation
c3-angular-directive copied to clipboard

call controller / scope function from as valueFormatFunction

Open gadeynebram opened this issue 8 years ago • 1 comments

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:

<div ng-controller="C3ChartController as chartCtrl"> <c3chart ....> <chart-tooltip valueFormatFunction="chartCtrl.formatValue(value)"></chart-tooltip> </<c3chart> </div>

or something like this does not either

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

gadeynebram avatar Jan 16 '17 10:01 gadeynebram

@gadeynebram You need to use it like this:

value-format-function="chartCtrl.formatValue"

NitsanBaleli avatar Sep 17 '18 12:09 NitsanBaleli