📄 unit1.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Form1->VtChart1->RandomFill;
//随机填充图表
Form1->ComboBox1->Items->Add("VtChChartType3dBar");
Form1->ComboBox1->Items->Add("VtChChartType2dBar");
Form1->ComboBox1->Items->Add("VtChChartType3dLine");
Form1->ComboBox1->Items->Add("VtChChartType2dLine");
Form1->ComboBox1->Items->Add("VtChChartType3dArea");
Form1->ComboBox1->Items->Add("VtChChartType2dArea");
Form1->ComboBox1->Items->Add("VtChChartType3dStep");
Form1->ComboBox1->Items->Add("VtChChartType2dStep");
Form1->ComboBox1->Items->Add("VtChChartType3dCombination");
Form1->ComboBox1->Items->Add("VtChChartType2dCombination");
Form1->ComboBox1->Items->Add("VtChChartType3dHorizontalBar");
Form1->ComboBox1->Items->Add("VtChChartType2dHorizontalBar");
Form1->ComboBox1->Items->Add("VtChChartType3dClusteredBar");
Form1->ComboBox1->Items->Add("VtChChartType3dPie");
Form1->ComboBox1->Items->Add("VtChChartType2dPie");
//填充列表项
Form1->VtChart1->ChartType=0;
//设置图表类型
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Form1->Hide();
//隐藏主窗体
Form1->VtChart1->UseWizard();
//显示向导程序
Form1->Show();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Form1->Hide();
Form2->Show();
//显示数据赋值窗体
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Form1->VtChart1->RandomFill;
//随机填充图表
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1Click(TObject *Sender)
{
Form1->VtChart1->ChartType=Form1->ComboBox1->ItemIndex;
//对图表使用当前选中的图表类型
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -