To get an angled 3D pie with a side wall I set the TChart::View3DOptions->Elevation property and the TChart::Chart3DPercent property. This works exactly as expected and the pie draws itself tilted with a sidewall below the pie.
However if I display the Marks, then they overlap with the 3D side wall of the pie.
Setting Marks->Clip=true makes no difference
Marks intersect with 3d Pie sidewall
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeI,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeI,
Thanks for the example, now I could see the problem you were reporting and this is TeeChart's normal behaviour. Where would you expect those marks ('502 and '732') to be drawn?
Thanks in advance.
Thanks for the example, now I could see the problem you were reporting and this is TeeChart's normal behaviour. Where would you expect those marks ('502 and '732') to be drawn?
Thanks in advance.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeI,
Ok, then you can do something like this:
Ok, then you can do something like this:
Code: Select all
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Boolean MarkInPie;
Chart1->Draw();
for (int i=0; i < Series1->Count()-1; i++)
{
MarkInPie = false;
int x0 = Series1->Marks->Positions->Position[i]->LeftTop.x;
int y0 = Series1->Marks->Positions->Position[i]->LeftTop.y-150;
int x1 = x0 + Series1->Marks->Positions->Position[i]->Width;
int y1 = y0 + Series1->Marks->Positions->Position[i]->Height;
if (Series1->Clicked(x0,y0) != -1) MarkInPie = true;
if (Series1->Clicked(x0,y1) != -1) MarkInPie = true;
if (Series1->Clicked(x1,y0) != -1) MarkInPie = true;
if (Series1->Clicked(x1,y1) != -1) MarkInPie = true;
if (MarkInPie)
{
Series1->Marks->Positions->Position[i]->Custom=true;
Series1->Marks->Positions->Position[i]->LeftTop.y += 75;
}
}
Chart1->Draw();
}
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 |
Marks intersect with 3D sidewall
Thanks Narcis
I have done as you suggest and then calculate the distance to move the mark according to the maximum height of the wall. But, there are cases where the wall gets smaller near the edges of the ellipse/sidewall. How can I calculate this area. I can send an example jpg if needed to illustrate the issue.
I get the maximum wall height as follows:
int ITPieSeries::GetMaxWallHeight ()
{
int iWallHeight = 0;
if (ParentChart && ParentChart->View3D)
{
int iMaxHeight = ParentChart->Height3D;
double iDegrees = 90 - (ParentChart->View3DOptions->Elevation - 270);
double dRadians = PiDegree * iDegrees;
double dSine = sin (dRadians);
iWallHeight = Round (iMaxHeight * dSine);
}
return iWallHeight;
}
I have done as you suggest and then calculate the distance to move the mark according to the maximum height of the wall. But, there are cases where the wall gets smaller near the edges of the ellipse/sidewall. How can I calculate this area. I can send an example jpg if needed to illustrate the issue.
I get the maximum wall height as follows:
int ITPieSeries::GetMaxWallHeight ()
{
int iWallHeight = 0;
if (ParentChart && ParentChart->View3D)
{
int iMaxHeight = ParentChart->Height3D;
double iDegrees = 90 - (ParentChart->View3DOptions->Elevation - 270);
double dRadians = PiDegree * iDegrees;
double dSine = sin (dRadians);
iWallHeight = Round (iMaxHeight * dSine);
}
return iWallHeight;
}
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MikeI,
I understand what you mean but it is not an easy thing to achieve. To calculate this area you may need some trigonometry based on pie's center and radius and on the chart's elevation. The easiest way would be considering it a regular wall.
I understand what you mean but it is not an easy thing to achieve. To calculate this area you may need some trigonometry based on pie's center and radius and on the chart's elevation. The easiest way would be considering it a regular wall.
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 |