Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In case chart height is not set via CSS, gives an error #12

Closed
bebraw opened this issue Jan 8, 2014 · 6 comments
Closed

In case chart height is not set via CSS, gives an error #12

bebraw opened this issue Jan 8, 2014 · 6 comments

Comments

@bebraw
Copy link

bebraw commented Jan 8, 2014

In case chart height is not set, it is very easy to end up with this D3 error:

Error: Invalid negative value for <svg> attribute height="-18" 

You might want to add a warning there to make the library nicer to use.

@chinmaymk
Copy link
Owner

Yup, shouldn't be too hard. Will add this soon.

@chinmaymk
Copy link
Owner

Issue fixed.

@cerw
Copy link

cerw commented Aug 1, 2014

I have set CSS h/w but still getting Please set height and width for the chart element ?

@chrisphyre
Copy link

I'm in the same boat:

  var totalWidth = element[0].clientWidth;
  var totalHeight = element[0].clientHeight;

always return zero. I suspect that perhaps the link function is being called prior to that portion of the page being rendered, so the values are zero. I've tried applying the width/height properties to an ID, via class, and inline via style="", and in any of the the cases clientWidth and clientHeight still return zero. Will continue investigating.

@chrisphyre
Copy link

I debugged this further, and at least in my case, is related to Angular bootstrap-ui tabs being used. Then I ran into this posting:

#76

@techno2mahi
Copy link

I have looked at the plunker and tried to fork this with AngularJS v1.4.6 (It was using AngularJS v1.2.2) then its not working.

Can any one guide here if it is working on latest angularjs versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants