141
Views
4
Comments
Solved
Unable to add  2 lines in a  single Line chart.
Question

I have an entity called Order Which look like this. I want to make a line graph as shown below. I am unable to add 2 types of data point while configuring the line graph.

If such graph is not possible please recommend any other type of graph.

(Note: I want to compare the amount and the number of orders with respect to date.)

2019-07-25 15-05-16
Henrique Silva
Solution
2019-07-25 15-05-16
Henrique Silva

Hello @Shlok Agrawal!

Assuming you are using OutSystems charts, to have multiple lines(or slices of pie, or any other division of data on a chart) you need to specify different data series when providing the source data to the chart.

Example:

For the chart you have shown in your picture, you would have to build a list each datapoint, using the Date in the Label attribute of the list structure, the numbers as the Value attribute and either "Total Number of orders" or "Total Amount" as the value in the DataSeriesName attribute.

The chart component will then group datapoints with the same DataSeriesName in same line.

2025-12-17 21-10-06
Shlok Agrawal

I am not able to add multiple data series, could you help me please.  

2019-07-25 15-05-16
Henrique Silva

Here is one way you can do it

1. Fetch data to your screen and set the output variable's datatype to DataPoint List. This structure is from the Outsystems chart module.

2. Then use the ListAppendAll server action from the System module to add your data to the Outout variable. As the data type of the output var is not the same as the datatype of the agreggate, you will be forced to do the mapping of the attributes to the structure. In this mapping is where you will specify the DataSeriesName. I Used Brand 1 and Brand 2.

3. Then you can use the GetDatapoints.Datapoints variable as the source list of your chart!


Hope this helps to answer your question :)

2019-07-25 15-05-16
Henrique Silva
Solution
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.