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

📄 ucolor.pas

📁 delphi多层应用系统 delphi多层应用系统
💻 PAS
字号:
{****************************************}
{ TeeChart                               }
{ TColoredForm Example                   }
{ Copyright (c) 1995,96 by David Berneda }
{    All Rights Reserved                 }
{****************************************}
unit ucolor;

interface

uses
  Wintypes,WinProcs, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Teengine, Series, ExtCtrls, Chart, StdCtrls, Buttons, teeprocs;

type
  TColoredForm = class(TForm)
    Chart1: TChart;
    Panel1: TPanel;
    CheckBox1: TCheckBox;
    BitBtn2: TBitBtn;
    LineSeries1: TLineSeries;
    PointSeries1: TPointSeries;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.DFM}

procedure TColoredForm.FormCreate(Sender: TObject);

  Procedure AddColors(Series:TChartSeries);
  var step:Double;
      t:Longint;
  begin
    With Series,GetVertAxis do
    begin
      step:=(Maximum-Minimum)/10.0;
      for t:=0 to Count-1 do
          ValueColor[t]:=GetDefaultColor( Trunc((YValue[t]-Minimum)/step) );
    end;
  end;

begin
  LineSeries1.FillSampleValues(100);
  PointSeries1.FillSampleValues(100);
  Chart1.LeftAxis.AdjustMaxMin;
  AddColors(LineSeries1);
  AddColors(PointSeries1);
end;

procedure TColoredForm.CheckBox1Click(Sender: TObject);
begin
  Chart1.LeftAxis.Inverted:=CheckBox1.Checked;
end;


end.

⌨️ 快捷键说明

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