added support for multiple charts