TChart-图表编辑器的测试
最近不知怎么的,想研究一下图表。先上效果图:

功能代码:
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-图表编辑器的测试的更多相关文章
- Cocos2d-x中常用粒子编辑器ParticleDesigner测试例子
打开 ParticleDesigner 随意选择一种效果 选择save. 类型选择 cocosd(plist)类型保存至桌面 命名为myplist导出至桌面 选择右侧Emitter Config可设置 ...
- [译]如何在Unity编辑器中添加你自己的工具
在这篇教程中你会学习如何扩展你的Unity3D编辑器,以便在你的项目中更好的使用它.你将会学习如何绘制你自己的gizmo,用代码来实现创建和删除物体,创建编辑器窗口,使用组件,并且允许用户撤销他们所作 ...
- android测试分析1
Android测试框架,开发环境中集成的一部分,提供一个架构和强有力的工具 可以帮助测试你的应用从单元到框架的每个方面. 测试框架有这些主要特征: 1.Android测试组件基于Junit.你可以使用 ...
- iozone测试磁盘性能
什么是iozone? iozone是一个文件系统的benchmark工具,可以测试不同的操作系统中文件系统的读写性能. 可以测试 Read, write, re-read,re-write, read ...
- Unity StreamingMipmaps 简单测试
StreamingMipmaps是Unity2018.2中加入的新功能,意指通过CPU控制,只加载部分Mipmap图片以节省更多的内存及显存空间. 我测试时遇到了问题,后来发现必须打包出来测才有效(注 ...
- [开发笔记]-Jqplot图表初体验
文章内容为初次使用Jqplot图表插件的测试代码,仅供参考. <html xmlns="http://www.w3.org/1999/xhtml"> <head& ...
- 使用iozone测试磁盘性能
IOzone是一个文件系统测试基准工具.可以测试不同的操作系统中文件系统的读写性能.可以通过 write, re-write, read, re-read, random read, random w ...
- FastReport.Net使用:[23]图表(Chart)控件
图表基本设置 1.拖放一个图表控件到报表设计界面中. 2.右键菜单“编辑”或者双击图表进入图表编辑器 3.将原有的簇状柱状图删除,添加圆环图 4.绑定数据源,并且指定X,Y轴数据. X轴数据为科目名称 ...
- 使用iozone测试磁盘性能(测试文件读写)
IOzone是一个文件系统测试基准工具.可以测试不同的操作系统中文件系统的读写性能.可以通过 write, re-write, read, re-read, random read, random w ...
随机推荐
- Java 中序列化与反序列化
一. 序列化和反序列化概念 Serialization(序列化)是一种将对象以一连串的字节描述的过程:反序列化deserialization是一种将这些字节重建成一个对象的过程.将程序中的对象,放入文 ...
- Docker的基本使用与简介
1 Docker简介 1.1 什么是虚拟化 在计算机中,虚拟化(英语:Virtualization)是一种资源管理技术,是将计算机的各种实体资源,如服务器.网络.内存及存储等,予以抽象.转换后呈现出来 ...
- 手写Tomcat
学习JavaWeb之后,只知道如何部署项目到Tomcat中,而并不了解其内部如何运行,底层原理为何,因此写下此篇博客初步探究一下.学习之前需要知识铺垫已列出:Tomcat目录结构.HTTP协议.IO. ...
- .NET Core之单元测试(一):入门
目录 什么是单元测试 .NET Core中的测试框架 一个最基础的单元测试 我们再看看上面的代码 什么是单元测试 单元测试是对软件中的最小可测试单元进行检查和验证.对于单元测试,要保证测试粒度足够小, ...
- Hadoop fs 使用方法
hdfs的基本命令 hdfs dfs -help 查看帮助 在HDFS的文件系统中,HDFS只支持绝对路径 1.-ls: 显示目录信息 hadoop fs -ls / 列出指定目录下的内容 2. ...
- linux 统计文件夹下文件,文件夹,所有个数
统计某文件夹下文件的个数 ls -l |grep "^-"|wc -l 统计某文件夹下目录的个数 ls -l |grep "^d"|wc -l 统计文件夹下文件 ...
- 以stm32f407为例,学习cortex-m4通用寄存器的用法
测试代码如下: int add(int a, int b, int c, int d, int e, int f) { return a+b+c+d+e+f; } int main(void) { i ...
- HDU 1042 大数阶乘
B - 2 Time Limit:5000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Statu ...
- 在Django中连接MySQL数据库(Python3)
我的环境: python3.6, Django2.1.5, MySQL8.0.15, win10, PyCharm, 要求:已经安装了MySQL数据库 ...
- 数组翻转(非reverse)
var arr = [1,2,3,4]; var arr2 = []; while(arr.length) { var num = arr.pop(); //删除数组最后一个元素并返回被删除的元素 a ...