⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ucolor.cpp

📁 TeeChart Pro ActiveX是西班牙Steema SL公司开发的图表类控件
💻 CPP
字号:
/*********************************************/
/* TeeChart Delphi Component Library 4.0     */
/* Demo                                      */
/* Copyright (c) 1995-1998 by David Berneda  */
/* All rights reserved                       */
/*********************************************/
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "UColor.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TColoredForm *ColoredForm;
//---------------------------------------------------------------------------
__fastcall TColoredForm::TColoredForm(TComponent* Owner)
  : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void TColoredForm::AddColors(TChartSeries* Series)
{
  double step = (Series->GetVertAxis->Maximum - Series->GetVertAxis->Minimum)/10.0;
  for (int t=0;t<Series->Count();t++)
    Series->ValueColor[t] = GetDefaultColor(
      (Series->YValue[t] - (int)(Series->GetVertAxis->Minimum) / step));
}

void __fastcall TColoredForm::FormCreate(TObject *Sender)
{
  LineSeries1->FillSampleValues(100);
  PointSeries1->FillSampleValues(100);
  Chart1->LeftAxis->AdjustMaxMin();
  AddColors(LineSeries1);
  AddColors(PointSeries1);
}
//---------------------------------------------------------------------------
void __fastcall TColoredForm::CheckBox1Click(TObject *Sender)
{
  Chart1->LeftAxis->Inverted = CheckBox1->Checked;
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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