Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TeeChart CrossTab Charts

115 views
Skip to first unread message

kimmerkc

unread,
Apr 29, 2009, 4:31:03 PM4/29/09
to
I have a TDBChart connected to a TDBCrossTabSource to provide data for
a number of series. I've encountered a host of problems, most of
which I've managed to find a way around, but I'm hoping someone can
help me through this one.

My data generates 10 series (as TBarSeries) as a result of the
CrossTab calculation. I am setting some aspects of the individual
bars at run time like so:

//turn series marks on, but make each individual one invisible
for i := 0 to DBChart1.SeriesCount-1 do
begin
DBChart1.Series[i].Active := TRUE;
DBChart1.Series[i].SeriesColor := ColorSeries(DBChart1.Series
[i].Title);
TBarSeries(DBChart1.Series[i]).Dark3D := FALSE;
DBChart1.Series[i].Marks.Show;
for j := 0 to DBChart1.Series[i].XValues.Count-1 do
DBChart1.Series[i].Marks[j].Hide;
end;

The current problem is that the Bars are of inconsistent width. When
I maximize the screen, the first bar disappears entirely until I
uncheck another of the series in the legend. Checking all ten series
makes that first one disappear again. This is not the case in the
smaller size (not maximized) but in that case some of the bars are
narrower than others and difficult to read.

I am not setting CustomBarWidth for each series in the code above, so
I would expect it to default to 0 and the Chart would draw itself to
an appropriate size. I tried manually setting the CustomBarWidth
value in the above code, but a set size is either too wide or too
narrow in various views.

Before I go to the trouble of writing a whole function to properly
resize bars relative to the size of the screen - which seems to me
something that should have been built in to the component - is there
some property I am overlooking that will make this graph play nice?

Also, I have set the Chart's "MaxPointsPerPage" value manually, as
there are enough X Values in my data to make the bars impossible to
read if all are on the screen at once. An AutoPage property to
determine the optimal number of points per page for a given Min or Max
Bar Width would be nice, but I haven't found any such thing.

Suggestions?

0 new messages