Stacked bar

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

Stacked bar

Post by David » Fri Mar 05, 2004 10:46 am

I'm running with 4 series connected to IBQuery components on a DB chart. The chart is a stacked bar graph. With some queries there is space between the bars when each bar should sit on top of each other. Is there any way I can correct this problem?

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

Post by Marjan » Fri Mar 05, 2004 11:28 am

Hi, David.

The stacking algorithm will work correctly only if all bars have the same number of (valid) points and all points x values coincide. If this is not the case, stacking will fail and you'll end up with chart "type" you reported.

Workarounds :
- First, make sure all points really have the same number of non-null points.
- Next make sure all points have the same x values (for bar series this should not be problematic since x value is usually automatic point index)

In one of these two conditions is not met you'll have to manually populate series with data (using add method) and use AddNull method to add missing null points. Only then will the stacking algorithm work correctly.
Marjan Slatinek,
http://www.steema.com

David
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am

Post by David » Mon Mar 08, 2004 1:11 pm

I see. I was hoping that it would treat null values within a query but I guess not. I'll have to try it manually then.

Thanks
Dave

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

Post by Marjan » Mon Mar 08, 2004 3:49 pm

Hi, David.

Hmm... If you have some missing values in the query (true nulls, not zeros), then the internal algorithm should use the AddNull method to add null points. Can you check if the missing values in Query are really nulls ?
Marjan Slatinek,
http://www.steema.com

Post Reply