Page 1 of 1

group exploded pie chart slices or create 2 color slice

Posted: Mon Nov 30, 2009 2:11 pm
by 15654666
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.

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

Posted: Mon Nov 30, 2009 2:35 pm
by 15654666
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?

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

Posted: Mon Nov 30, 2009 4:29 pm
by yeray
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;

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

Posted: Mon Nov 30, 2009 7:29 pm
by 15654666
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.

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

Posted: Mon Nov 30, 2009 9:19 pm
by 15654666
In other words, in your example, how would I make the border between cars and bikes transparent?

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

Posted: Tue Dec 01, 2009 4:18 pm
by yeray
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).