Page 1 of 2

set diameter programmatically

Posted: Mon May 16, 2022 9:49 am
by dmasterplan
how can I set the pie chart's diameter programmatically?

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

Please help!

Re: set diameter programmatically

Posted: Mon May 16, 2022 2:54 pm
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.

Re: set diameter programmatically

Posted: Tue May 17, 2022 12:22 am
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!

Re: set diameter programmatically

Posted: Tue May 17, 2022 8:08 am
by Max Shamanov
Hello,

Do you want set diameter in events or runtime?

Thank you.

Re: set diameter programmatically

Posted: Tue May 17, 2022 8:29 am
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.

Re: set diameter programmatically

Posted: Tue May 17, 2022 11:34 am
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.

Re: set diameter programmatically

Posted: Tue May 17, 2022 1:01 pm
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.

Re: set diameter programmatically

Posted: Tue May 17, 2022 2:27 pm
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.

Re: set diameter programmatically

Posted: Wed May 18, 2022 2:25 am
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!

Re: set diameter programmatically

Posted: Wed May 18, 2022 6:28 am
by Lech Kulikowski
Hello,

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

Thank you.