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
How to draw TTowerSeries side-by-side?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Wiebe,
You can try doing something like this:
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 |
Instructions - How to post in this forum |
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
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
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 );
}
}
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 );
}
}