chinmaymk / angular-charts

angular directives for creating common charts using d3
MIT License
1.03k stars 270 forks source link

Charts can't be displayed within tabs #215

Open carolineBda opened 8 years ago

carolineBda commented 8 years ago

Hello,

If you try to display a chart within an tab (or anything which will gets loaded with a style display:none) then the error "Please set height and width for the chart element" is throw. Even if an height and width is set to the char class.

umair321 commented 8 years ago

Facing same issue without tabs :(

daniel-halldorsson commented 8 years ago

same here, also without tabs, happens on resize

fireworkstudio commented 7 years ago

@carolineBda @umair321 @daniel-halldorsson I add two scope variables in directive, and now it works. But this is not a final solution, I am still wait for official resolution.

1) Add two scope variables in directive image 2) Replace the places using element[0]'s width and height to new variables image 3) In your view template, add new attributes image 4) In your controller, define the values image

You may refer to codes of my project: angular-charts.min.js dashboard.html dashboard-controller.js

Here is the screenshot, hope this method will help you solve the problem image