最近不知怎么的,想研究一下图表。先上效果图:

功能代码:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TeeEdit, ExtCtrls, TeeProcs, TeEngine, Series, Chart, StdCtrls,
ComCtrls; type
TForm1 = class(TForm)
ChartEditorPanel1: TChartEditorPanel;
ChartEditor1: TChartEditor;
ChartEditorPanel2: TChartEditorPanel;
Chart1: TChart;
Series1: TBarSeries;
Series2: TBarSeries;
Button1: TButton;
ComboBox1: TComboBox;
Label1: TLabel;
ComboBox2: TComboBox;
Label2: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure ComboBox2Change(Sender: TObject);
procedure Chart1ClickAxis(Sender: TCustomChart; Axis: TChartAxis;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure Chart1ClickLegend(Sender: TCustomChart; 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
Self.Position := poScreenCenter;
//右下角图表编辑器树形显示
ChartEditorPanel2.Editor.Tree.Visible := True;
//随机添加10个数
Series1.FillSampleValues();
Series2.FillSampleValues();
end; procedure TForm1.Button1Click(Sender: TObject);
begin
ChartEditor1.Execute;
end; procedure TForm1.ComboBox1Change(Sender: TObject);
var
Pos: TTabPosition;
begin
Pos := tpTop;
case ComboBox1.ItemIndex of
: Pos := tpTop;
: Pos := tpBottom;
: Pos := tpLeft;
: Pos := tpRight;
end;
ChartEditorPanel1.Editor.TabGeneral.PageControl.TabPosition := Pos;
end; procedure TForm1.ComboBox2Change(Sender: TObject);
var
ts: TTabStyle;
begin
ts := tsTabs;
case ComboBox2.ItemIndex of
: ts := tsTabs;
: ts := tsButtons;
: ts := tsFlatButtons;
end;
ChartEditorPanel1.Editor.TabGeneral.PageControl.Style := ts;
end; procedure TForm1.Chart1ClickAxis(Sender: TCustomChart; Axis: TChartAxis;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ChartEditorPanel1.Editor.TabAxis.Show;
ChartEditorPanel1.Editor.TabAxis.PageControl.ActivePage.PageIndex;
end; procedure TForm1.Chart1ClickLegend(Sender: TCustomChart;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ChartEditorPanel1.Editor.TabLegend.Show;
end; end.

界面代码:

object Form1: TForm1
Left =
Top =
Width =
Height =
Caption = '图表编辑器ChartEditor和ChartEditorPanel功能演示'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch =
TextHeight =
object Label1: TLabel
Left =
Top =
Width =
Height =
Caption = 'Tabs位置:'
end
object Label2: TLabel
Left =
Top =
Width =
Height =
Caption = 'Tabs风格:'
end
object ChartEditorPanel1: TChartEditorPanel
Left =
Top =
Width =
Height =
Chart = Chart1
TabOrder =
end
object ChartEditorPanel2: TChartEditorPanel
Left =
Top =
Width =
Height =
Chart = Chart1
TabOrder =
end
object Chart1: TChart
Left =
Top =
Width =
Height =
Title.Text.Strings = (
'图表编辑器测试')
OnClickAxis = Chart1ClickAxis
OnClickLegend = Chart1ClickLegend
TabOrder =
object Series1: TBarSeries
Marks.Callout.Brush.Color = clBlack
Marks.Visible = True
SeriesColor =
Gradient.Direction = gdTopBottom
XValues.Name = 'X'
XValues.Order = loAscending
YValues.Name = 'Bar'
YValues.Order = loNone
end
object Series2: TBarSeries
Marks.Callout.Brush.Color = clBlack
Marks.Visible = True
SeriesColor = clSilver
Gradient.Direction = gdTopBottom
XValues.Name = 'X'
XValues.Order = loAscending
YValues.Name = 'Bar'
YValues.Order = loNone
end
end
object Button1: TButton
Left =
Top =
Width =
Height =
Caption = '调用图表编辑器'
TabOrder =
OnClick = Button1Click
end
object ComboBox1: TComboBox
Left =
Top =
Width =
Height =
Style = csDropDownList
ItemHeight =
TabOrder =
OnChange = ComboBox1Change
Items.Strings = (
'Top'
'Bottom'
'Left'
'Right')
end
object ComboBox2: TComboBox
Left =
Top =
Width =
Height =
Style = csDropDownList
ItemHeight =
ItemIndex =
TabOrder =
Text = 'Tabs'
OnChange = ComboBox2Change
Items.Strings = (
'Tabs'
'Buttons'
'FlatButtons')
end
object ChartEditor1: TChartEditor
Chart = Chart1
Left =
Top =
end
end

TChart-图表编辑器的测试的更多相关文章

  1. Cocos2d-x中常用粒子编辑器ParticleDesigner测试例子

    打开 ParticleDesigner 随意选择一种效果 选择save. 类型选择 cocosd(plist)类型保存至桌面 命名为myplist导出至桌面 选择右侧Emitter Config可设置 ...

  2. [译]如何在Unity编辑器中添加你自己的工具

    在这篇教程中你会学习如何扩展你的Unity3D编辑器,以便在你的项目中更好的使用它.你将会学习如何绘制你自己的gizmo,用代码来实现创建和删除物体,创建编辑器窗口,使用组件,并且允许用户撤销他们所作 ...

  3. android测试分析1

    Android测试框架,开发环境中集成的一部分,提供一个架构和强有力的工具 可以帮助测试你的应用从单元到框架的每个方面. 测试框架有这些主要特征: 1.Android测试组件基于Junit.你可以使用 ...

  4. iozone测试磁盘性能

    什么是iozone? iozone是一个文件系统的benchmark工具,可以测试不同的操作系统中文件系统的读写性能. 可以测试 Read, write, re-read,re-write, read ...

  5. Unity StreamingMipmaps 简单测试

    StreamingMipmaps是Unity2018.2中加入的新功能,意指通过CPU控制,只加载部分Mipmap图片以节省更多的内存及显存空间. 我测试时遇到了问题,后来发现必须打包出来测才有效(注 ...

  6. [开发笔记]-Jqplot图表初体验

    文章内容为初次使用Jqplot图表插件的测试代码,仅供参考. <html xmlns="http://www.w3.org/1999/xhtml"> <head& ...

  7. 使用iozone测试磁盘性能

    IOzone是一个文件系统测试基准工具.可以测试不同的操作系统中文件系统的读写性能.可以通过 write, re-write, read, re-read, random read, random w ...

  8. FastReport.Net使用:[23]图表(Chart)控件

    图表基本设置 1.拖放一个图表控件到报表设计界面中. 2.右键菜单“编辑”或者双击图表进入图表编辑器 3.将原有的簇状柱状图删除,添加圆环图 4.绑定数据源,并且指定X,Y轴数据. X轴数据为科目名称 ...

  9. 使用iozone测试磁盘性能(测试文件读写)

    IOzone是一个文件系统测试基准工具.可以测试不同的操作系统中文件系统的读写性能.可以通过 write, re-write, read, re-read, random read, random w ...

随机推荐

  1. HDU_3853_概率dp

    http://acm.hdu.edu.cn/showproblem.php?pid=3853 又因为总期望为子期望的加权和,加权因子为子期望的转移概率,所以得到:dp[ i ][ j ]= p1 * ...

  2. Codeforces Round #620 F2. Animal Observation (hard version) (dp + 线段树)

    Codeforces Round #620 F2. Animal Observation (hard version) (dp + 线段树) 题目链接 题意 给定一个nm的矩阵,每行取2k的矩阵,求总 ...

  3. ElasticSearch基础入门学习笔记

    前言 本笔记的内容主要是在从0开始学习ElasticSearch中,按照官方文档以及自己的一些测试的过程. 安装 由于是初学者,按照官方文档安装即可.前面ELK入门使用主要就是讲述了安装过程,这里不再 ...

  4. Yandex Big Data Essentials Week1 Unix Command Line Interface Processes managing

    free displays the total amount of free and used memory free [options] top provides a dynamic real-ti ...

  5. PHP 中 new static 和 new self 的区别

            今天老大在公司 问了一下  new static  和 new self 的区别 公司十个程序 竟然没有一个回答上来 后面画面自补 ... 本屌丝回家后 就百度了解了下 这二者区别 : ...

  6. C++ 类的赋值运算符'='重载

    什么类需要重载赋值运算符 先来看一个普通类的直接赋值. #include <iostream> using namespace std; class person{ int age; pu ...

  7. Kali桥接模式下配置ip

    以管理员身份运行虚拟机 打开控制面板-->网络和Internet-->更改适配器 再在虚拟机处桥接到这个WLAN2 点击 编辑-->编辑虚拟网卡 没有网卡就点上图的添加网络作为桥接网 ...

  8. XAMPP与ISS在80端口冲突问题

    1.在control界面上通过apach行的config,选择httpd.conf,将其中的listen和ServerName localhost:后面的80改为8080. 2.打开control最右 ...

  9. Laravel + Serverless Framework 快速创建 CMS 内容管理系统

    今天,为大家带来一篇 Laravel + Serverless Framework 的综合实战,里面信息量有点多,大家仔细看哦- 首先,我来介绍下主要的本地环境吧: Git:不多说,只要会敲代码就应该 ...

  10. xmppmini 项目详解:一步一步从原理跟我学实用 xmpp 技术开发 2.登录的实现

    第二章登录的实现 金庸<倚天屠龙记> 张三丰缓缓摇头,说道:“少林派累积千年,方得达成这等绝技,决非一蹴而至,就算是绝顶聪明之人,也无法自创.”他顿了一顿,又道:“我当年在少林寺中住过,只 ...