1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| void __fastcall TForm1::UnZoom(TObject *Sender){
AnsiString name =((TChart*)Sender)->Name;
if( name =="Chart1" && fst_uz ){
Chart1->BottomAxis->Automatic = true;
Chart2->BottomAxis->Automatic = true;
fst_uz = false;
Chart2->UndoZoom();
fst_uz = true;
}
else if(name =="Chart2"&&fst_uz){
Chart1->BottomAxis->Automatic = true;
Chart2->BottomAxis->Automatic = true;
fst_uz = false;
Chart1->UndoZoom();
fst_uz = true;
}
}
void __fastcall TForm1::Synchroniser(TObject *Sender){
if(((TChart*)Sender)->Name =="Chart1"){
Chart2->BottomAxis->Automatic = false;
Chart2->BottomAxis->SetMinMax(Chart1->BottomAxis->Minimum,Chart1->BottomAxis->Maximum);
} if(((TChart*)Sender)->Name =="Chart2"){
Chart1->BottomAxis->Automatic = false;
Chart1->BottomAxis->SetMinMax(Chart2->BottomAxis->Minimum,Chart2->BottomAxis->Maximum);
}
} |
Partager