Creating a Chart with a Flow
  • 27 Jun 2024
  • 2 Minutes to read
  • Dark
    Light

Creating a Chart with a Flow

  • Dark
    Light

Article summary




Prerequisites:

  • Entity (Folder, Datatype, Database, etc)

Example

The example below will use the following Database Structure:

Animal
Data MemberType
NameString [Text]
SpeciesString [Text]
AgeInt32 [Number]


  1. Create a Page.
  2. In the Toolbox panel of the Page Designer, navigate to REPORTS > CHARTS. Select a chart and place it on the Page workspace. This example will use the Columns chart.
  3. On the Properties panel, enter a Title for the Chart.
  4. Under the CHART DATA category, click the dropdown menu under Mode and select Use flow.
  5. Click PICK OR CREATE DATA FLOW, select CREATE NEW, click Chart Data Flow, enter a Name and click CREATE. 
  6. Click the Done path of the Start step. Navigate to All Steps [Catalog] > Data. Select the Create Data step and click ADD.
  7. On the Properties panel, click SHOW EDITOR under Data to Create.
  8. In the Data to Create window under NAME, enter "OutputC". In the TYPE field, enter "chartrenderdata" and select ChartRenderData [DecisionsFramework...]. Select the IS LIST checkbox. Click Save and close the window.
  9. Click the Done path and navigate to All Steps [Catalog] > Database. Select the Fetch Entities step and click ADD.
  10. On the Properties panel, set the Type Name field to the desired Entity type. If using a Case Entity, set the Type Name to Folder [DecisionsFramework...] and Extenstion Type Name to the Case Entity.
  11. Click the Results path and navigate to All Steps [Catalog] > Flow Management > Iteration. Select the ForEach In Group step and click ADD.
  12. On the Properties panel, set the Type field under the DATA category to the Type Name used in the Fetch Entities step. Under the INPUTS category, set the Field to Group By to any desired field from the Entity chosen. This example will use Species from the Animal Database Structure. Click EDIT under the Collection field and select EntityResults.
  13. Under OUTPUTS, set the mapping for Each Grouping to Rename and enter "Each Grouping".
  14. Click the Next Group path and navigate to All Steps [Catalog] > Data > List. Select the Add Item to List Step and click ADD.
  15. On the Properties panel under the DATA category, set the ListType to ChartRenderData [DecisionsFramework...].
  16. Set the New Item field mapping to Build Data. Select Ignore next to the Key field and enter "Species".
  17. Change the mapping for Value from Ignore to Build Array. Set the mapping of Item 0 to Build Data.
  18. Change the ColorOpacity mapping to Constant and enter "1".
  19. For the ColorString field, enter "rgba(42,123,33,1)". Set the values of ColumnName, DisplayLabel, Label, RowName, and Title to "Species".
  20. Change the mapping of Value to Select from Flow. Select Each Grouping >  All Species > Count and click DONE.
  21. Change the mapping of Original List to Select From Flow and select OutputC.
  22. Under the OUTPUT category, map the New List field to Change Value and pick OutputC.
  23. Connect the No Results path and the Done path of the ForEach In Group step to the End Step. Connect the Done path of the Add Item to List step to the ForEach In Group step.
  24. Select the End step and map the Chart Data to OutputC.
  25. Click Save and close the Designer.
  26. Click Save and close the Page Designer. 
  27. Add the Page to a Designer Folder to see the chart created.



For further information on Pages, visit the Decisions Forum.



Was this article helpful?