ulegend.cpp

来自「TeeChart Pro ActiveX是西班牙Steema SL公司开发的图表」· C++ 代码 · 共 39 行

CPP
39
字号
/*********************************************/
/* TeeChart Delphi Component Library 4.0     */
/* Demo                                      */
/* Copyright (c) 1995-1998 by David Berneda  */
/* All rights reserved                       */
/*********************************************/
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "ULegend.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TLegendForm *LegendForm;
//---------------------------------------------------------------------------
__fastcall TLegendForm::TLegendForm(TComponent* Owner)
  : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TLegendForm::LineSeries2AfterDrawValues(TObject *Sender)
{
  // we'll draw over PaintBox1
  for (int t = 0;t<Chart1->SeriesCount();t++) {  // for each Series in Chart
    PaintBox1->Canvas->Font->Color = Chart1->Series[t]->SeriesColor;  // set font color
    // draw the customized Series Title
    PaintBox1->Canvas->TextOut(40,20+16*t,
      "This is a long Series title: "+Chart1->SeriesTitleLegend(t));
  }
}
//---------------------------------------------------------------------------
void __fastcall TLegendForm::FormCreate(TObject *Sender)
{
  LineSeries1->FillSampleValues(50); // random values
  LineSeries2->FillSampleValues(50);
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?