quick untested port of mac chart drawing to UIKit APIs