Page 1 of 1

Simple Bar Chart - 2 Series Side by Side

Posted: Fri Jan 30, 2004 4:53 pm
by 8573434
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

Posted: Mon Feb 02, 2004 11:39 am
by Pep
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 %';