Rewrite graphs.

Only depend on matlabchart, not gdchart or pygooglechart.

Change-Id: I2cf2a930b4aff834f53d773811074ae4029fadcf