实现数据的图表统计

dsetStaticData组件的Data属性中录入以下数据:
41, 5, 1, 'John Smith', 'Canada'
34, 3, 2, 'John Smith', 'Canada'
14, 5, 3, 'John Smith', 'Canada'
14, 4, 4, 'John Smith', 'Canada'
12, 7, 5, 'John Smith', 'Canada'
14, 5, 6, 'John Smith', 'Canada'
15, 5, 7, 'John Smith', 'Canada'
16, 5, 8, 'John Smith', 'Canada'
12, 8, 9, 'John Smith', 'Canada'
14, 3, 10, 'John Smith', 'Canada'
51, 3, 11, 'John Smith', 'Canada'
51, 5, 12, 'John Smith', 'Canada'
35, 6, 1, 'Lisa Green', 'Canada'
55, 5, 2, 'Lisa Green', 'Canada'
75, 6, 3, 'Lisa Green', 'Canada'
55, 8, 4, 'Lisa Green', 'Canada'
55, 5, 5, 'Lisa Green', 'Canada'
21, 7, 9, 'Bob Jones', 'United States'
41, 8, 10, 'Bob Jones', 'United States'
11, 9, 11, 'Bob Jones', 'United States'
11, 0, 12, 'Bob Jones', 'United States'
54, 9, 1, 'Jim Crawford', 'Canada'
54, 3, 2, 'Jim Crawford', 'Canada'
54, 4, 3, 'Jim Crawford', 'Canada'
54, 4, 4, 'Jim Crawford', 'Canada'
16, 4, 9, 'David House', 'United States'
16, 3, 10, 'David House', 'United States'
56, 6, 11, 'David House', 'United States'
56, 3, 12, 'David House', 'United States'
53, 3, 1, 'Fernando Hernandez', 'Mexico'
53, 5, 2, 'Fernando Hernandez', 'Mexico'
33, 6, 3, 'Fernando Hernandez', 'Mexico'

unit IWUnit1;
{PUBDIST}

interface

uses
  IWAppForm, IWApplication, IWTypes, Classes, Controls, IWControl,
  IWCompListbox, IWDBStdCtrls, IWCompDynamicChart,
  IWClientSideDatasetDBLink, IWClientSideDatasetBase, IWClientSideDataset,
  IWCompButton, IWCompLabel, IWCompDynamicChartLegend, DB, DBTables;

type
  TformMain = class(TIWAppForm)     
    IWLabel1: TIWLabel;
    IWLabel2: TIWLabel;
    IWLabel3: TIWLabel;
    IWLabel4: TIWLabel;
    IWButton1: TIWButton;
    cmboHorz: TIWComboBox;
    cmboVert: TIWComboBox;
    cmboData: TIWComboBox;
    IWComboBox1: TIWComboBox;
    DemoChart: TIWDynamicChart;
    IWDynamicChartLegend1: TIWDynamicChartLegend;   
    dsetStaticData: TIWClientSideDataset;
    dsetMaster: TIWClientSideDatasetDBLink;
    DataSource1: TDataSource;
    Table1: TTable;
    procedure IWAppFormCreate(Sender: TObject);
    procedure cmboDataChange(Sender: TObject);
  public
  end;

implementation
{$R *.dfm}

uses
  ServerController;

procedure TformMain.IWAppFormCreate(Sender: TObject);
begin
  cmboDataChange(Sender);
end;

procedure TformMain.cmboDataChange(Sender: TObject);
begin
  case cmboData.ItemIndex of
    0: DemoChart.Data := dsetStaticData;
    1: DemoChart.Data := dsetMaster;
  end;
  DemoChart.Data.GetColumnNames(cmboHorz.Items);
  DemoChart.Data.GetColumnNames(cmboVert.Items);
  cmboHorz.ItemIndex := 0;
  DemoChart.HorzData := cmboHorz.Items[0];
  cmboVert.ItemIndex := 0;
  DemoChart.VertData := cmboVert.Items[0];
end;
end.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值