Any chart - multiple arrays

0
Hello everyone,  Our app is used in a healthcare setting and is used to monitor various things for people we support. Some of these areas of recording are plotted on a scatter plot (using AnyChart). When I first set it up it was quite early in my Mendix journey and I created a ridiculous microflow that had 242 actions and built the JSON as it went.  More recently I've learnt how to actually get Mendix to generate the JSON and have done so for one of these scatter plots, where the microflow looks like this   This is for monitoring records that plot when certain behaviours have been witnessed, and at the moment it only has one array and outputs JSON like this:   [ { "x":[ 6, 8, 6, 27 ], "y":[ 12, 7, 12, 15 ], "mode":"markers", "type":"scatter", "marker":{ "size":17 } } ]   In another type of record, we have an entity (call it “Support Record”) and an enumeration (“Support Type”) with 8 options (Type 1 – *). We need the scatter plot to have for each “Support Type” as a different symbol. Which would mean using 8 arrays. The catch is that not all 8 types will be used for every scatter plot.  My thinking is that the above microflow would be changed so it runs the same thing up to 8 times (one for each type in the enum), then stitch together the JSON using a create string variable. There would be some added logic that counts how many of each type of record there are. Once it’s working on the last one it just won’t add the comma that separates the arrays.  I hope i’ve explained that well, it feels like a laborious way to do it, does anyone have any suggestions.  TIA  
asked
1 answers
0

May be I am misunderstanding your problem but could you not just create 8 different export mappings and depending on the type use one of these 8 mappings?

Regards,

Ronald

 

answered