make charts work with json data