-
Notifications
You must be signed in to change notification settings - Fork 78
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
Setting graph width in pixels from dashboards.js metrics #69
Comments
Not entirely sure why it doesn't work, because these parameters are simply passed over to Rickshaw, which should support it. Perhaps I need to update the version of Rickshaw, but it hasn't been updated in a while as far as I can tell. I think the best way to set the width is by controlling the html element, via css. This falls back on the element width and should automatically adjust correctly. |
I updated giraffe to use the latest version of rickshaw. Could you check if it makes a difference? |
So I went ahead and cloned the new code. It doesn't seem to read or set the width in rickshaw. |
So on line 281 in giraffe.js it has "width: $("" + anchor + " .chart").width()," changing that to "width: metric.width || 300," fixes the issue. Would you like to go ahead and update your giraffe.coffee/giraffe.js ? |
You're referring to the compiled javascript. The source files is giraffe.coffee. However, this is the code that picks the width from the CSS element, which makes sense to me more than relying on passing the width via javascript. Any particular reason why you prefer to pass the width instead of set it based on the container element CSS ? |
just pushed a change that should fix this. Would be great if you could test and let me know if it works for you. Thanks for reporting this. |
Sorry took a while to get back gingerlime, it works great! Thanks for the help. |
Thanks for reporting this and for testing and letting me know. Glad to hear it's working now :) |
When setting the width as 500px in the metrics its not being obeyed, <svg width="375" ...
Am I doing this wrong?
dashboard.js snippet
The text was updated successfully, but these errors were encountered: