|
답변 감사합니다.
Chart Tools의 Annotation tool 이란게 따로 구매를 해야 하는건가요?
아님 C++ Builder에 포함되어 있는건가요?
참고로 전 5.0을 사용하고 있거든요.
smleelms 님이 쓰신 글 :
: Chart Tools의 Annotation tool을 응용하시면 될것같네요.
: 혹 최근 Example이 있으시면 Tools - Annotation - Annotation Callout 을 한번 보시기 바랍니다.
: 그리고 샘플코드 일부 추가합니다.
:
: //---------------------------------------------------------------------------
: void __fastcall TAnnotationCO::SetCallout(int AIndex)
: {
: // Change annotation text
: ChartTool1->Text = "Point: "+IntToStr(AIndex)+TeeLineSeparator+
: "Value: "+Series1->ValueMarkText[AIndex];
:
: // Re-position annotation callout
: ChartTool1->Callout->Visible = true;
: ChartTool1->Callout->XPosition = Series1->CalcXPos(AIndex);
: ChartTool1->Callout->YPosition = Series1->CalcYPos(AIndex);
: ChartTool1->Callout->ZPosition = 0;
: }
: //---------------------------------------------------------------------------
: // Returns Series point index that is nearest to xy position.
: int __fastcall TAnnotationCO::NearestPoint(TChartSeries *ASeries, int x, int y)
: {
: int res = -1;
: int Difference = -1;
: int tmpDif;
: for (int t=0; t<ASeries->Count(); t++)
: {
: tmpDif = int(TeeDistance(ASeries->CalcXPos(t)-x,ASeries->CalcYPos(t)-y));
: if (Difference==-1 || tmpDif<Difference)
: {
: Difference = tmpDif;
: res = t;
: }
: }
: return res;
: }
: //---------------------------------------------------------------------------
: void __fastcall TAnnotationCO::Chart1MouseMove(TObject *Sender,
: TShiftState Shift, int X, int Y)
: {
: if (CheckBox1->Checked) // follow mouse
: {
: // Locate nearest point to mouse...
: int tmp = NearestPoint(Series1, X, Y);
: if (tmp!=-1) SetCallout(tmp); // set annotation callout
: }
: }
: //---------------------------------------------------------------------------
|