group exploded pie chart slices or create 2 color slice

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ccc
Newbie
Newbie
Posts: 8
Joined: Tue Nov 17, 2009 12:00 am

group exploded pie chart slices or create 2 color slice

Post by ccc » Mon Nov 30, 2009 2:11 pm

I am trying to create something like the attached excel pie chart overlay with teecharts, but with each "section" exploded and in 3D.

Does anyone know the code to explode 2 slices of a pie chart, but have them side by side (not exploded from each other). Another option is to be able make a percentage of a slice one color, and the rest of the slice another color. The goal is for either one slice to show 2 pieces of information (invested and uninvested in this example), or for two side by side slices to accomplish the same. Thanks in advance.
Attachments
piepic.JPG
piepic.JPG (26.5 KiB) Viewed 9295 times

ccc
Newbie
Newbie
Posts: 8
Joined: Tue Nov 17, 2009 12:00 am

Re: group exploded pie chart slices or create 2 color slice

Post by ccc » Mon Nov 30, 2009 2:35 pm

2 more questions: what is the code to create the outlined border of the pie chart and to only outline the border of every other slice like in the attachment?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: group exploded pie chart slices or create 2 color slice

Post by Yeray » Mon Nov 30, 2009 4:29 pm

Hi ccc,

I'm afraid that having two slices exploded together it's not possible right now. I'll add this to the wish list to be implemented in future releases. Maybe we should consider adding slice groups. We will study what's the best option to achieve that.

Right now, what you can do is to assign the same color to two slices. Something as follows:

Code: Select all

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;

            Steema.TeeChart.Styles.Pie pie1 = new Steema.TeeChart.Styles.Pie(tChart1.Chart);

            pie1.Circled = true;
            pie1.Add(20,"Cars");
            pie1.Add(15, "Bikes");
            pie1.Add(5, "Trucks", pie1.ValueColor(1));
            pie1.Add(15, "Bycicles");
            pie1.Add(35, "Vans");
        }
ccc wrote:what is the code to create the outlined border of the pie chart and to only outline the border of every other slice like in the attachment?
Is that what you are looking for?

Code: Select all

pie1.Pen.Width = 3;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ccc
Newbie
Newbie
Posts: 8
Joined: Tue Nov 17, 2009 12:00 am

Re: group exploded pie chart slices or create 2 color slice

Post by ccc » Mon Nov 30, 2009 7:29 pm

Thank you Yeray. A couple of follow ups: how do I remove the outline between two slices? Also, how do I make sure the outline goes around the outside if I set the color of a slice to transparent? Thanks.

ccc
Newbie
Newbie
Posts: 8
Joined: Tue Nov 17, 2009 12:00 am

Re: group exploded pie chart slices or create 2 color slice

Post by ccc » Mon Nov 30, 2009 9:19 pm

In other words, in your example, how would I make the border between cars and bikes transparent?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: group exploded pie chart slices or create 2 color slice

Post by Yeray » Tue Dec 01, 2009 4:18 pm

Hi ccc,

I'm afraid I can't think on a way to do this right now. The only think is to hide completely the pen:

Code: Select all

pie1.Pen.Visible = false;
I've added this in the same ticket as probably adding groups of slices would help to achieve that too (TF02014578).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply