Hello All,
We've been using TeeChart for many years. But I can't figure out what I am doing wrong in this code (BDS C++ Builder 2010, TeeChart 8.06). Can anyone tell me what is wrong? The vectors get added fine. But in the loop it throws an exception when trying to set "Custom" to true for the first item.
DcmChart->Draw();
DcmSeries->Clear();
DcmSeries->AddVector( 1, 1, 1, 2, 1, 1, "Nose", clBlue );
DcmSeries->AddVector( 1, 1, 1, 1, 2, 1, "Wing", clBlue );
DcmSeries->AddVector( 1, 1, 1, 1, 1, 2, "Down", clBlue );
for ( unsigned int i=0; i<3; ++i )
{
DcmSeries->Marks->Positions->Position->Custom = true;
DcmSeries->Marks->Positions->Position->LeftTop.x = DcmSeries->CalcXPosValue( DcmSeries->EndXValues->Value );
DcmSeries->Marks->Positions->Position->LeftTop.y = DcmSeries->CalcXPosValue( DcmSeries->EndYValues->Value );
}
Series Error at runtime?
Re: Series Error at runtime?
Hi Mike,
I think you should force the series to show the marks before modifying them and also force a Chart draw after adding your series' points. So it would be something like this:
I think you should force the series to show the marks before modifying them and also force a Chart draw after adding your series' points. So it would be something like this:
Code: Select all
DcmSeries->Clear();
DcmSeries->AddVector( 1, 1, 1, 2, 1, 1, "Nose", clBlue );
DcmSeries->AddVector( 1, 1, 1, 1, 2, 1, "Wing", clBlue );
DcmSeries->AddVector( 1, 1, 1, 1, 1, 2, "Down", clBlue );
DcmSeries->Marks->Visible = true;
DcmChart->Draw();
for ( unsigned int i=0; i<3; ++i )
{
DcmSeries->Marks->Positions->Position[i]->Custom = true;
DcmSeries->Marks->Positions->Position[i]->LeftTop.x = DcmSeries->CalcXPosValue( DcmSeries->EndXValues->Value[i] );
DcmSeries->Marks->Positions->Position[i]->LeftTop.y = DcmSeries->CalcXPosValue( DcmSeries->EndYValues->Value[i] );
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 14
- Joined: Fri Jun 22, 2007 12:00 am
Re: Series Error at runtime?
That fixed it! Thanks!