angular-dc icon indicating copy to clipboard operation
angular-dc copied to clipboard

dc-chart-group needs to use scope.$eval() ?

Open asquithea opened this issue 10 years ago • 2 comments

When I set a chart group, collective chart filtering seemed to stop working. My initial syntax was:

<div dc-chart-group="records" dc-chart="barChart"  ...>

This is used directly in chartFactory(chartElement, chartGroupName) on line 34, but then calls chartGroup(undefined) in getOptionsFromAttrs() on line 83, because "records" is presumably interpreting it as a variable on the scope.

Changing the line 34 call would make the scope.$eval call consistent:

var chart = chartFactory(chartElement, scope.$eval(chartGroupName))

Then the directive needs to be used with the chart name quoted as follows:

<div dc-chart-group="'records'" dc-chart="barChart"  ...>

asquithea avatar Sep 05 '14 17:09 asquithea

@asquithea Thank you, I'll have a chance to review this next week, feel free to submit a PR.

:+1:

TomNeyland avatar Sep 12 '14 19:09 TomNeyland

Any update on this issue?

zhx828 avatar Jan 19 '15 20:01 zhx828