Page 1 of 1

[solved] Problem with a TChartShape

Posted: Fri Aug 31, 2007 10:36 am
by 9235956
Hi,

I have a problem in my program with a TChartShape.
First I create this series in my code with these instructions :

Code: Select all

TChartShape *serieTexte;   
serieTexte = new TChartShape(this);
serieTexte->Active = true; 
serieTexte->Visible=true;
serieTexte->Style = chasRectangle;
serieTexte->Transparent=true;
graphDetail->AddSeries(serieTexte);
In run time i can see this my serie.
Then I want to move my serie on my graph with these instructions :

Code: Select all

TChartShape *serieTexte;   
serieTexte = new TChartShape(this);
serieTexte->Active = true; 
serieTexte->Visible=true;
serieTexte->Style = chasRectangle;
serieTexte->Transparent=true;

serieTexte->AddXY(60,60);
serieTexte->AddXY(140,140);

graphDetail->AddSeries(serieTexte);
And here is the problem, i can't see my serie even so my axis scales are correct. the serie has disappear.
Do you know where is my mistake ?
Regards

Posted: Fri Aug 31, 2007 11:36 am
by narcis
Hi lp,

The problem is on how you populate shape series. You need to use X0, Y0, X1 and Y1 properties as shown here:

Code: Select all

	TChartShape *serieTexte;
	serieTexte = new TChartShape(this);
	serieTexte->Active = true;
	serieTexte->Visible=true;
	serieTexte->Style = chasRectangle;
	serieTexte->Transparent=true;

	//serieTexte->AddXY(60,60);
	//serieTexte->AddXY(140,140);

	serieTexte->X0=60;
	serieTexte->Y0=60;
	serieTexte->X1=140;
	serieTexte->Y1=140;

	graphDetail->AddSeries(serieTexte);

Posted: Fri Aug 31, 2007 12:08 pm
by 9235956
Hi Narcis,

Thank you very much, your solution have solve my problem.
Regards.