Dynamic Line Chart displaying results from a table using one parameter as a variable

Dynamic Line Chart displaying results from a table using one parameter as a variable

  

Hi

I am having difficulty in finding an example and to what components are needed to demonstrate the following (Simplified example).


(1) Entity table containing number of work orders completed, resources by week

(2) UI- Line graph displaying weekly orders completed

(3) UI Combo box for the number of resources is a variable and can be changed to forecast cases to be completed

Say number of cases completed per resource is 4.  With two resources this would double to 8 on the line graph etc..


#My approach

Create aggregate  of weekly data of resources and costs

Set up Local variable = aggregate above

Create action on combo change

- update local with aggregate list

- Assign value of combo to local .  Ie assign new resource value and calculate.factor orders that can be completed

When action is run the line graph updates

However I cannot source  line graph to local variable and I think my methodology is wrong.  I am also not sure if I should be using structures.  I would greatly appreciate if anyone can let me know the steps/guidance I need to take and recorrect my approach?


Thanks




Hi Yasantha, 

you can assign a local variable as the source for a chart.

Or, you can create an action Server Action to return returns an output to source the chart. 

Just make sure your variable has the type "Data Point List" (a list of data points).


You can see an example in the Sales App on forge. Just downnload it and check how is implemented: https://www.outsystems.com/forge/component/582/sales/

Hi .  I am trying to mimic the same setup as Sales App example, and have made progress but cant quite get the line bar to yet work with the right results.

I think it has mainly to do with the two output parameters

-  DataPoint - Record

- DatapointList - List by record

Q1) Why do you need two export parameters?

Q2) DataPoint export parameter seems to be redundant.  Is the best way to set this up to right click List then create a structure within the command then select record.? This seems to be rather cumbersome. 

Q3) From my understanding we are creating an action eg. DataPointReturn to run on the Preparation of the WebScreen.  Then records are appended to a local variable e.g DataPointList. Then its is Apended to the action by using ListAppend.  This will return the value for e.g a line graph when the action is on the preparation is called on input parameter of the line graph.  Is this correct? 


Thanks