我昨天的DEMO已经DEL了。我没有找到,我又写一个。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TeEngine, Series, OHLChart, CandleCh, ExtCtrls, TeeProcs, Chart;
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TCandleSeries;
procedure FormCreate(Sender: TObject);
procedure Series1Click(Sender: TChartSeries; ValueIndex: Integer;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(100);
end;
procedure TForm1.Series1Click(Sender: TChartSeries; ValueIndex: Integer;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
case ValueIndex of
0..99: Showmessage(Format('ValueIndex=%d, XValue=%f,Yvalue=%f', [Valueindex,
TCandleSeries(Sender).XValues[ValueIndex],
TCandleSeries(Sender).YValues[ValueIndex]]));
end;
end;
end.