Charting: highlight final column in series differently

Stimulsoft Reports.NET discussion
Post Reply
User avatar
John
Posts: 132
Joined: Tue Feb 01, 2011 3:56 am
Location: England

Charting: highlight final column in series differently

Post by John »

Hallo Support,

I have been requested to create a bar chart with a single series where the final column has a different colour, as in the example:
sample chart
sample chart
S1.png (23.77 KiB) Viewed 922 times
To do this, I add a condition on the series, which in code looks as follows:

Code: Select all

            this.Item88.Conditions.Add(new Stimulsoft.Report.Chart.StiChartCondition(System.Drawing.Color.FromArgb(255, 134, 17, 11), Stimulsoft.Report.Components.StiFilterItem.Value, Stimulsoft.Report.Components.StiFilterDataType.Numeric, Stimulsoft.Report.Components.StiFilterCondition.GreaterThanOrEqualTo, "30"));
Unfortunately, this has two drawbacks:
1). at runtime in code, I must access this condition and replace the artificial value "30" with the real value of the final column. This is not such a problem and only requires a couple of lines of code.
2). The StiChartCondition only allows me to define a single colour as the first argument. This means that the other columns all have a nice gradient to them but the final column can only have one fill-colour.

Is there any way I can set up the series in the MRT to say -> take the final column and give it style XX? By the way, the number of columns can vary between 3 and 7.

Thanks and regards,

John Kitching
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Charting: highlight final column in series differently

Post by HighAley »

Hello, John.
John wrote:1). at runtime in code, I must access this condition and replace the artificial value "30" with the real value of the final column. This is not such a problem and only requires a couple of lines of code.
Unfortunately, this is the only way to set condition of the chart now.
John wrote:2). The StiChartCondition only allows me to define a single colour as the first argument. This means that the other columns all have a nice gradient to them but the final column can only have one fill-colour.
Please, try to set the Style of the chart to Style01 or any other where Gradient is used. In this case the last column wll be with gradient too.

Thank you.
Post Reply