Actually, I might have to rewrite this in canvas to get acceptable performance out of it. Currently, it takes 10ms/frame (on my computer) to do the relayout calculations for the two charts.