Add unit tests to chart functions.