Simple Bar Chart - 2 Series Side by Side

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Rory
Newbie
Newbie
Posts: 1
Joined: Fri Nov 15, 2002 12:00 am

Simple Bar Chart - 2 Series Side by Side

Post by Rory » Fri Jan 30, 2004 4:53 pm

I have 2 Series from Datasets and for the sake of discussion lets say each series has a Fruit type and a Value.

Series1
Apples 2
Bananas 3
Cherries 4
Oranges 1

Series2
Bananas 6
Oranges 12

First Problem. I would like to see the bar charts such that each fruit and value appear next to each other. Ie. the Bananas are together and the Oranges are together. Where there is no corresponding fruit in Series2 there should be a 0 value bar. When I set up the datasets, instead what I get is the Apples from Series1 next to Bananas in Series2 and Bananas in Series1 next to Oranges in Series2. I can't figure out how to let TChart know that my X-Values are common and need to be grouped together.

Second Problem. I can get around this one, but if there is a built in or preferred method I'd like to know. Basically I'm not really interested in the actual value I'm interested in the weightings of my series. So from my example Series 1 is 20% Apples, 30% Bananas, 40% Cherries and 10% Oranges. Series 2 is 33% Bananas and 67% Oranges. I could change my query to pass in Percents rather than the values. But it would be nice if I could have the Y-Axis plot percentage rather than value.

Hopefully this made sense.

Other info: TChart Pro v.6 Delphi 7

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

Post by Pep » Mon Feb 02, 2004 11:39 am

Hi Rory,
First Problem. I would like to see the bar charts such that each fruit and value appear next to each other. Ie. the Bananas are together and the Oranges are together. Where there is no corresponding fruit in Series2 there should be a 0 value bar. When I set up the datasets, instead what I get is the Apples from Series1 next to Bananas in Series2 and Bananas in Series1 next to Oranges in Series2. I can't figure out how to let TChart know that my X-Values are common and need to be grouped together.
How about using :

Code: Select all

Series1.MultiBar := mbSideAll;
Second Problem. I can get around this one, but if there is a built in or preferred method I'd like to know. Basically I'm not really interested in the actual value I'm interested in the weightings of my series. So from my example Series 1 is 20% Apples, 30% Bananas, 40% Cherries and 10% Oranges. Series 2 is 33% Bananas and 67% Oranges. I could change my query to pass in Percents rather than the values. But it would be nice if I could have the Y-Axis plot percentage rather than value.
Generally the axis labels (numeric) are formatted according to
TChartAxis.AxisValuesFormat string. This can be any valid format string. For
example, a percent format :

Code: Select all

  Chart1.Axes.Left.AxisValuesFormat := '0.00 %';

Post Reply