Refactor abstract chart widget out of graph widget

This is a necessary step for #94. Also low priority, so this ticket might be around for a while.