TomNeyland / angular-dc

AngularJS directives for dc.js
http://tomneyland.github.io/angular-dc/
MIT License
112 stars 59 forks source link

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

Open asquithea opened 10 years ago

asquithea commented 10 years ago

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"  ...>
TomNeyland commented 10 years ago

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

:+1:

zhx828 commented 9 years ago

Any update on this issue?