Closed linagee closed 10 years ago
This is useful. I will try and implement this as soon as I can.
@linagee this has been merged into master. The option "autofit" = "true|false" has been added to the directive.
Keep in mind that this implementation will not redraw unless it is actually necessary on account of a dimension change for a specific graph. This is more efficient than redrawing each graph every time the browser is resized regardless of whether dimensions on a particular graph have been changed.
If you need to force a redraw, I can expose a function to do that in the controller scope but I cannot think of a use case for that so I have not included it so far.
I think you removed the autofit option with this commit
@commodoretyler
Yes I did. It is no longer needed.
Use this native option now:
<canvas responsive="true"></canvas>
Would you mind adding 'responsive' option back into readme example, where previously autofit option was mentioned? It would make it so much easier to find.
@leriel The responsive
option is actually a Chart.js native option, along with many (20+) other default chart options you can choose from.
I encourage you to read the Chart.js documentation for these options as the directives provided by this angular plugin simply pass the options straight through to the native Chart object.
I will not be duplicating the Chart.js documentation here since that would mean keeping it up to date.
@petermelias good point. I didn't earlier understand what you meant by native. Thanks for the reply.
Are you planning on adding a resize listener so the canvas gets redrawn on resize? This is for Responsive Web Design. http://en.wikipedia.org/wiki/Responsive_web_design
https://github.com/lgsilver/angles/blob/master/angles.js is doing this now, just wondering if this connector will have it or not. Thanks.