3D bars not drawn correctly

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

3D bars not drawn correctly

Post by Mitan » Mon May 10, 2004 10:51 am

In TeeChart V5.02 with Delphi 5, vertical 3D bars are not drawn correctly (hidden line/surface not handled correctly). Some while ago I was told this would get fixed in a later release. I cannot see this bug listed in the Release Notes for any version on the web site. Is this bug fixed yet, and if so in which release? I need to get this bug fixed, but I'd rather not go to V7 which is only recently released, and may contain other problems.

I can provide a screenshot which illustrates the problem, which affects a very ordinary use of TeeChart, no complicated combination of facilities.

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

Post by Pep » Mon May 10, 2004 12:23 pm

Hi,

I'm going to need an example or code with which I can reproduce the problem here, could you please post it or tell me the steps I must do ?

Mitan
Newbie
Newbie
Posts: 4
Joined: Fri Nov 15, 2002 12:00 am
Contact:

3D bars not drawn correctly

Post by Mitan » Mon May 10, 2004 2:45 pm

Yes, I have a screenshot which I can send you -how do I do it? I need an email address to send to.

The code used to produce the chart has a lot of non-TeeChart code around it, but basically is very simple. A chart with four TBarSeries is created in the Delphi IDE, with the bars stacked in a single group. The application code then does Clear for each series, then adds data with
SeriesName.AddXY(X,Yn,TextForLabel,ColorForSeries)
for a range of X values.

Mitan
Newbie
Newbie
Posts: 4
Joined: Fri Nov 15, 2002 12:00 am
Contact:

3D stacked charts

Post by Mitan » Mon May 10, 2004 4:56 pm

I found another entry in the forum which sounds like the problem that I am describing, under the title "Serious bug in 3D stacked charts". Looks like something fundamental is wrong with TeeChart - a simple stacked bar chart is a very straightforward use of TeeChart, I'm amazed it has gobe unfixed for so long.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon May 10, 2004 8:14 pm

Hi.

The bug is still there, but it's actually a drawing bug, not a bug with how values are stacked. The problem is in normal 3d canvas (the OpenGL doesn't have this problem) TeeChart itnernal code cannot correctly figure out the order for drawing 3d bars. The end result is some surfaces which should be hidden are not. We're aware of this problem. Workarounds : switch to 2d, use OpenGL. Hopefully we'll fix a suitable fix (not only for bar series, but for all 3d stacked series) for next release.
Marjan Slatinek,
http://www.steema.com

Mitan
Newbie
Newbie
Posts: 4
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Post by Mitan » Tue May 11, 2004 8:07 am

I tried using OpenGL for the chart. OpenGL does not, as you say, have the 3D drawing problem, but the general appearance, especially of text in labels and headings, is very poor, and not acceptable for a commercial application. Maybe there are ways of improving the text with OpenGL, but that would represent a very large amount of work for something that is essentially just a work-around for a bug. The only workable solution seems to be to remove the 3D option, but that removes one of the major reasons for using a charting package like TChart. Do other packages (e.g. ChartFX - distributed with Delphi although almost unusable because of poor documentation) suffer from the same problem, i.e. is the 3D drawing problem something to do with Windows, or is it within the TChart implementation?

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue May 11, 2004 12:41 pm

Hi.

The problem is in Teechart drawing routine (drawing order). The problem is fixable, but so far we haven't found a good solution yet.
Marjan Slatinek,
http://www.steema.com

statistician
Newbie
Newbie
Posts: 2
Joined: Mon Aug 23, 2004 4:00 am

stacked bar charts still not correct

Post by statistician » Mon Feb 27, 2006 11:22 am

I have just installed Delphi6 and TeeChart 7.06. TeeChart still does not draw a straightforward (2D) stacked bar chartr correctly. Some of the series have bars that are too wide, so they spill over into the next bar. The base bar seems ok, but other bars are not the same width. Is there a reasonably simple work-around for this? Otherwise, how can a bug like this, for a straightforward common type of chart, be allowed to persist so long?

statistician
Newbie
Newbie
Posts: 2
Joined: Mon Aug 23, 2004 4:00 am

Stacked bar problems

Post by statistician » Mon Feb 27, 2006 1:59 pm

I have found some things which avoid the 2D stacked bar problem I had.
(1) I was doing my own calculation of bar width and setting CustomebarWidth. This calculation was based on ChartRect (equivalently ChartWidth) divided by the number of bars I need to plot. I have found that ChartWidth was not set (was zero) on the first drawing of the chart. So I now use Chart.Width, reduced by a percentage to allow for axes and so on. Chart.Width is reliable. See (2) below, but I also have a TLineSeries overlaid on the bars, and I also calculate the width of the pen used to draw this line.

(2) Setting CustomBarWidth, eben to a "known sensible" value, seems to give problems. Using BarWidthPercent seems to work ok.

Post Reply