fix chart plot calculations