Stacked bar chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
smcmickens
Newbie
Newbie
Posts: 11
Joined: Thu Mar 06, 2003 5:00 am

Stacked bar chart

Post by smcmickens » Mon Jun 07, 2004 9:18 pm

Is there a way to have the marks on a stacked bar chart display on "top" of the bar the mark applies to instead of "behind" the next bar on the stack? Also, is there a way to have it where each series containing a stacked bar is sorted by the actual value of the y axis and not the label?

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Jun 08, 2004 7:51 am

Hi,

the easiest way to move marks inside is to set marks arrowlength property to negative value. Another possibility (a bit more complicated, but more customizable) is to move marks by using custom positioning.

smcmickens
Newbie
Newbie
Posts: 11
Joined: Thu Mar 06, 2003 5:00 am

Post by smcmickens » Tue Jun 08, 2004 2:26 pm

Thanks, that worked. Is there a way you can display the total of all values in the stack at the end of the stack? Also, how can you get it to where each stack is sorted by the actual value instead of the label? For example, I have a graph that displays the number of times a safety incident has occured for each supervisor by type of incident in the plant. When I use stack horizontal bars, it displays the number of incidents by each type for each supervisor in the order of incident type and not in the order of number of incidents. Is there a way of having it sort by number of incidents for each supervisor?

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jun 09, 2004 3:56 pm

Hi,
Is there a way you can display the total of all values in the stack at the end of the stack?
Yes, one way could be to customize the Mark of one series in the OnGetMarkText and make the other Marks Series invisible.
Also, how can you get it to where each stack is sorted by the actual value instead of the label? For example, I have a graph that displays the number of times a safety incident has occured for each supervisor by type of incident in the plant. When I use stack horizontal bars, it displays the number of incidents by each type for each supervisor in the order of incident type and not in the order of number of incidents. Is there a way of having it sort by number of incidents for each supervisor?
Yes, you can use the Order property :
Code :

Code: Select all

horizBar1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
horizBar1.XValues.Sort();
horizBar1.YValues.FillSequence();
horizBar2.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
horizBar2.XValues.Sort();
horizBar2.YValues.FillSequence();

Post Reply