发信人: coolfans()
整理人: teleme(2000-12-06 19:10:56), 站内信件
|
【 在 t_venus (傻子) 的大作中提到: 】
:
:
: 你可以看一下 Delphi 下的一个范例程序,是关于 CGI 显示 DBChart的。
:
: .......
我看过范例,那是将IMAG图象从数据库中读出来显示,我现在想用TDBChart
生成,但是总是出错“Control '' has no parent window”!
代码如下:
procedure TWebModule1.WebModule1Create(Sender: TObject);
begin
// open the database table
Table1.Open;
// create the chart
Chart := TDBChart.Create (nil); //在这里就错了!!!
Chart.Width := 600;
Chart.Height := 400;
Chart.AxisVisible := False;
Chart.Legend.Visible := False;
Chart.BottomAxis.Title.Caption := 'Name';
// create the pie series
Series := TPieSeries.Create (Chart);
Series.ParentChart := Chart;
Series.DataSource := Table1;
Series.XLabelsSource := 'Name';
Series.OtherSlice.Style := poBelowPercent;
Series.OtherSlice.Text := 'Others';
Series.OtherSlice.Value := 2;
Chart.AddSeries (Series);
// create the memory bitmap
Image := TImage.Create (nil);
Image.Width := Chart.Width;
Image.Height := Chart.Height;
end;
-- 当爱已成往事,我心陨落在零度空间
※ 修改:.coolfans 于 Jun 18 19:16:50 修改本文.[FROM: 61.139.12.187] ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 61.139.12.187]
|
|