How to draw TTowerSeries side-by-side?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Wiebe
Newbie
Newbie
Posts: 21
Joined: Wed May 11, 2005 4:00 am
Location: Middelburg
Contact:

How to draw TTowerSeries side-by-side?

Post by Wiebe » Sun Apr 02, 2006 7:47 pm

BCB6 + TC7.05

TTowerSeries has no Multibar property.
Is there a way to draw two TTowerSeries in the same Chart side-by-side?

Thanks in advance,

Wiebe

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Apr 03, 2006 9:21 am

Hi Wiebe,

You can try doing something like this:

Code: Select all

void __fastcall TForm1::FormCreate(TObject *Sender)
{
	Randomize;

	Series1->PercentDepth=50;
	Series1->PercentWidth=50;
	Series2->PercentDepth=50;
	Series2->PercentWidth=50;

	for (int i=0; i <= 10; i++)
		for (int j=0; j <= 10; j++)
		{
			Series1->AddXYZ(i-0.5,i+j,j-0.5);
			Series2->AddXYZ(i+0.5,i*j,j+0.5);
		}
}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Wiebe
Newbie
Newbie
Posts: 21
Joined: Wed May 11, 2005 4:00 am
Location: Middelburg
Contact:

Post by Wiebe » Mon Apr 03, 2006 8:31 pm

Thanks Narcís,

This does not produce a side-by-side profile.

Following code (in Form constructor) comes closer:

double width=25.0;
Series1->PercentDepth=25;
Series1->PercentWidth=(int)width;
Series2->PercentDepth=25;
Series2->PercentWidth=(int)width;

for (int i=0; i <= 10; i++)
for (int j=0; j <= 10; j++)
{
Series1->AddXYZ((double)i-.005*width,i+j,j);
Series2->AddXYZ((double)i+.005*width,i+j,j);
}

However during rotation, since the "semi"adjacent bars are in fact treated as different objects, mutual coverage spoils the scenary.
There may be a better approach...

Wiebe

Wiebe
Newbie
Newbie
Posts: 21
Joined: Wed May 11, 2005 4:00 am
Location: Middelburg
Contact:

Post by Wiebe » Wed Apr 05, 2006 2:51 pm

Following code provides a better basis:

double width=25.0;
AnsiString s;
Series1->PercentDepth=25;
Series1->PercentWidth=(int)width;
Series2->PercentDepth=25;
Series2->PercentWidth=(int)width;

for (int i=0; i <= 10; i++)
{
for (int j=0; j <= 10; j++)
{
s = i;
Series1->AddXYZ((double)i-.005*width, i+j+2, j, s, clRed );
Series1->AddXYZ((double)i+.005*width, i+(j+2)/2, j, "", clGreen );
}
}

Post Reply