Query re. pulling data from Domain Model to create graph

0
Hi, Hopefully a simple question – maybe I’m not approaching this in the right way so feel free to suggest a better way to start from scratch! I have an entity ‘Products’ with ~10 attributes. 1 of these attributes is ‘stage’ (string enumeration). I want to extract from this, a simple bar chart showing ‘stage’ on the x axis, and number of ‘products’ on y. To do this, I have associated an entity ‘Graph’ (Many:1, products:graph). Graph has attributes of xStage , and yProductsAtStage. I have also created a microflow, which calculates sums and creates 6 objects in the ‘Graph’ entity, one for each stage. Question – how do I get these 6 objects passed to the page that will display the bar chart/graph? I feel like there is a more elegant solution than using Java or REST, but I can’t see it currently. Many Thanks.
asked
1 answers
0

Rob,

You should use the Charts widget (from the appstore).  You can pick your preferred chart and configure the datasource to grab the values from your Graph entity.  Seems like you’ll only need to create one Series if you’re using a bar graph.  Create a popup page with the chart, create a microflow to refresh the data in Graph and then open the popup page. 

Hope that helps,

Mike

**EDIT**

Some screenshots to provide a bit more insight.  I created the following domain model:

and made the following page:

Here is the configuration of the column chart

This is where you are indicating what entity you want the chart contents to come from

Some more details on the series I defined above:

and that should do it – this will give you a chart with all of the records in entity Graph.

If you want to only chart some Graph records, you could create an association between ChartContainer and Graph, like this

then your Chart config would be this

and the microflow to open this page would look like this

Does that help?

answered