set diameter programmatically

Stimulsoft Reports.NET discussion
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

set diameter programmatically

Post by dmasterplan »

how can I set the pie chart's diameter programmatically?

I don't know how to find it in code.

Please help!
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: set diameter programmatically

Post by Max Shamanov »

Hello,

You can use the following code:

Code: Select all

((sender as Stimulsoft.Report.Chart.StiChart).Series[0] as Stimulsoft.Report.Chart.StiDoughnutSeries).Diameter = 200F;
Thank you.
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: set diameter programmatically

Post by dmasterplan »

Hi,

Thanks for answering BUT

I can't make it work.
How about if I have a pie chart named ProcurementAwards, how can I set it's diameter programmatically?

and how can I find it in code?

Great Thanks!
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: set diameter programmatically

Post by Max Shamanov »

Hello,

Do you want set diameter in events or runtime?

Thank you.
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: set diameter programmatically

Post by dmasterplan »

What's the difference?

I want to set the diameter in events? BeforePrintEvent to be specific. Changing the diameter depending on the number of legends.
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: set diameter programmatically

Post by Lech Kulikowski »

Hello,

You can set the necessary option in the designer then open the Code tab and check how it should be set. Then you can use the similar code where you need it.

Thank you.
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: set diameter programmatically

Post by dmasterplan »

Hi,

When you set Design > Area > Border Color, you do:
this.Chart1_Area.BorderColor = System.Drawing.Color.Transparent;

How to do if Design > Series > Diameter?
You can't do Chart1_Series.Diameter right?

Please help, I don't have any idea how to do it.
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: set diameter programmatically

Post by Max Shamanov »

Hello,

You can use the following code:

Code: Select all

(this.Chart1.Series[0] as Stimulsoft.Report.Chart.StiDoughnutSeries).Diameter = 200F;
Thank you.
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: set diameter programmatically

Post by dmasterplan »

Hi,

I have Chart2 and applied the code:

Code: Select all

(this.Chart2.Series[0] as Stimulsoft.Report.Chart.StiDoughnutSeries).Diameter = 120F;
but it didn't work. Can you please help?

Great Thanks!
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: set diameter programmatically

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
Post Reply