angular-dimple icon indicating copy to clipboard operation
angular-dimple copied to clipboard

Responsive charts

Open mg1075 opened this issue 10 years ago • 3 comments

There is an "Advanced" example on the dimple website for responsive charts, and also a closed issue in Github. Is there a plan to add responsive features to this project?

mg1075 avatar Mar 28 '15 03:03 mg1075

The comment in the dimple responsive example has:

                // Add a method to draw the chart on resize of the window
                window.onresize = function () {
                    // As of 1.1.0 the second parameter here allows you to draw
                    // without reprocessing data.  This saves a lot on performance
                    // when you know the data won't have changed.
                    chart.draw(0, true);
                };

I think this should be made available to angular-dimple.graph in the directive, at least as an option to pass via attrs. Probably want to have the second parameter be an option, too.

mg1075 avatar Mar 28 '15 04:03 mg1075

This method is responsive and doesn't require redrawing on resize: http://jsfiddle.net/jasoncmcg/gkxrnonk/

jasoncmcg avatar May 05 '15 14:05 jasoncmcg

#61 by @danielmcquillen adds an attribute you can add to the chart called autoresize. This just got merged and hasn't been released yet, but after the next release you should be able to just add autoresize="true" and have it scale to the screen size.

paulcpederson avatar Dec 04 '15 21:12 paulcpederson