Home > Back-end >  C builer, how to realize the abscissa click the chart control?
C builer, how to realize the abscissa click the chart control?

Time:10-24

C + + builer, how to realize the abscissa click the chart control? Know a ClickAxis and GetAxisLabel events, but not used, I want to click here and get the value of the abscissa (I set here is that the time), I want to apply this time value query the database, get one day measurement record, ask everybody to help, thank you

CodePudding user response:

 
Void __fastcall TFrmChart: : ChartRxLevN1N2MouseUp (TObject * Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
TCustomChart * pSender=dynamic_cast & lt; TCustomChart * & gt; (the Sender);
Double Temp=pSender - & gt; The Series [0] - & gt; XScreenToValue (X);
}

CodePudding user response:

reference 1st floor feng038 response:
C/C + + code? 123456 void __fastcall TFrmChart: : ChartRxLevN1N2MouseUp (TObject * Sender, TMouseButton Button, TShiftState Shift, int X, int Y) {TCustomChart * pSender=dynamic_cast & lt; .

This just take the position of the abscissa, is not what I want, what I want is to deal with this event (ClickAxis events), the time value of the abscissa,

CodePudding user response:

 
Void __fastcall TForm2: : Chart1ClickAxis (TCustomChart * Sender, TChartAxis * Axis, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
TCustomChart * pSender=dynamic_cast & lt; TCustomChart * & gt; (the Sender);
Double Temp=pSender - & gt; The Series [0] - & gt; XScreenToValue (X);
UnicodeString Val=pSender - & gt; The Series [0] - & gt; XValueToText (Temp);
}
  • Related