Works ok in FMX.
How to I resolve this?
Thanks, Alan
Code: Select all
// VCL
//---------------------------------------------------------------------------
void __fastcall TfMain::bChartClick(TObject *Sender)
{
int i ;
FDMemTable->EmptyDataSet() ;
FDMemTable->Append() ;
FDMemTable->FieldValues["ID"] = 1 ;
FDMemTable->FieldValues["Input"] = 10 ;
FDMemTable->FieldValues["Output"] = 20 ;
FDMemTable->Append() ;
FDMemTable->FieldValues["ID"] = 2 ;
FDMemTable->FieldValues["Input"] = 20 ;
FDMemTable->FieldValues["Output"] = 40 ;
FDMemTable->Post() ;
Series1->Clear() ;
Series2->Clear() ;
FDMemTable->First() ;
do
{
Series1->AddXY(FDMemTable->FieldByName("ID")->AsInteger, FDMemTable->FieldByName("Input")->AsInteger, "", clBlack) ;
Series2->AddXY(FDMemTable->FieldByName("ID")->AsInteger, FDMemTable->FieldByName("Output")->AsInteger, "", clBlack) ;
FDMemTable->Next() ;
}while(!FDMemTable->Eof) ;
}
//---------------------------------------------------------------------------
void __fastcall TfMain::bConnectClick(TObject *Sender)
{
Series3->DataSource = FDMemTable ;
Series4->DataSource = FDMemTable ;
Series3->XLabelsSource = "ID" ;
Series4->XLabelsSource = "ID" ;
Series3->YValues->ValueSource = "Input" ;
Series4->YValues->ValueSource = "Output" ;
}
//--------------------------------------------------------------------------
// FMX
//---------------------------------------------------------------------------
void __fastcall TfMain::bChartClick(TObject *Sender)
{
int i ;
BindSourceDB1->DataSource = 0 ;
FDMemTable->EmptyDataSet() ;
FDMemTable->Append() ;
FDMemTable->FieldValues["ID"] = 1 ;
FDMemTable->FieldValues["Input"] = 10 ;
FDMemTable->FieldValues["Output"] = 20 ;
FDMemTable->Append() ;
FDMemTable->FieldValues["ID"] = 2 ;
FDMemTable->FieldValues["Input"] = 20 ;
FDMemTable->FieldValues["Output"] = 40 ;
FDMemTable->Post() ;
BindSourceDB1->DataSource = dsFDMemTable ;
Series1->Clear() ;
Series2->Clear() ;
FDMemTable->First() ;
do
{
Series1->AddXY(FDMemTable->FieldByName("ID")->AsInteger, FDMemTable->FieldByName("Input")->AsInteger, "", TAlphaColor(claBlack)) ;
Series2->AddXY(FDMemTable->FieldByName("ID")->AsInteger, FDMemTable->FieldByName("Output")->AsInteger, "", TAlphaColor(claBlack)) ;
FDMemTable->Next() ;
}while(!FDMemTable->Eof) ;
}
//--------------------------------------------------------------------------
void __fastcall TfMain::bConnectClick(TObject *Sender)
{
Series3->DataSource = FDMemTable ;
Series4->DataSource = FDMemTable ;
Series3->XLabelsSource = "ID" ;
Series4->XLabelsSource = "ID" ;
Series3->YValues->ValueSource = "Input" ;
Series4->YValues->ValueSource = "Output" ;
}
//---------------------------------------------------------------------------