Fixed a bug in charting