moved chart painting code out of Chart and into ChartPainter to hide internal stuff from users of lib