Create a line in line chart as a sum of two other columns

Stimulsoft Reports.JS discussion
Post Reply
VladU
Posts: 5
Joined: Wed May 20, 2020 12:21 pm

Create a line in line chart as a sum of two other columns

Post by VladU »

Hello,

Could you please help me with the following issue? I have two columns: stat1 and stat2 and I want to create a line chart containing 3 lines: one for stat1, one for stat2 and the third one for the sum of stat1 and stat2.

I cannot figure what is the expression for the addition (sum) of the two stats (I've tried multiple combinations, starting from setting the Value field of the series to {test.stat1 + test.stat2}, but none have worked so far. Also, any pointers on how I would multiple a line by a factor?

I am attaching the .mrt file I am using. Your help would be much appreciated.

Best regards,
Vlad
Attachments
Sample_report.mrt
(10.2 KiB) Downloaded 84 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Create a line in line chart as a sum of two other columns

Post by Lech Kulikowski »

Hello,

You can add an additional calculated column in your data source (stat1+stat2) and then use it in chart.

Thank you.
VladU
Posts: 5
Joined: Wed May 20, 2020 12:21 pm

Re: Create a line in line chart as a sum of two other columns

Post by VladU »

Hello Lech,

Thank you for the information. Unfortunately, I've tried doing that and it did not work. Perhaps I am using the incorrect syntax as now, the line chart is not even displayed. I am attaching the file and the syntax I have used.

Best regards,
Vlad
Attachments
Sample_report_attempt1.mrt
(10.41 KiB) Downloaded 82 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Create a line in line chart as a sum of two other columns

Post by Lech Kulikowski »

Hello,

Your expression is not correct. Also, columns should be numeric types for correct result.

Thank you.
Attachments
Annotation 2020-08-16 105737.png
Annotation 2020-08-16 105737.png (225.59 KiB) Viewed 890 times
Post Reply