Charting: implement autoresize for charts

When browser window resizes, charts are recalculated.

Implements #1101 

More testing is needed especially for situation when chart is drawn and then removed from the screen while browser is still on the page.

@epwinchell, please, take a look if this fits your idea about #1101