Changed code to support all data types

First commit only supported the line chart, now the other charts are supported as well.