You need to create a domain model based on the JSON structure.
If you need some reference, what you could do is create the JSON structure in Mendix and create a import mapping using the JSON structure and use map automatically → This will create a structure based on your selected elements.
However, if you want to build lot of different charts using the same domain model then you will need to some design ahead so that it can be re-used (think of generalizing some stuff) for multiple charts. The easiest would be to pick two charts that you know would be used, and as and when you need to expand just add entities and attributes to it.
EDIT – You then need to create an export mapping and prefill the data in your entities before using that in your microflow. If there is a lot of data you can also look at OQL to speed up the processing. But this will take some time to setup.
Hope this helps!
Take a look at this Youtube explanation. Might be a good start.