W
wenweiya
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
filename:string;
msexcel:variant;
msexcelworkbook:variant;
msexcelworksheet,achart:variant;
begin
filename:='C:/PO统计复件12.xls';
if filename<>'' then
begin
msexcel:=createoleobject('Excel.application');
msexcelworkbook:=msexcel.workbooks.open(filename);
msexcelworksheet:=msexcel.workbooks[1].worksheets[1];
msexcelworksheet.Activate;
achart:=msexcelworksheet.chartobjects.add(100,100,800,300);
achart.chart.charttype:=51;
achart.chart.SetSourceData('sheet1!$A$31:$B$47',2);
achart.chart.seriescollection.NewSeries;
achart.chart.seriescollection.NewSeries;
achart.chart.SeriesCollection[1].name:='坐标轴说明1';
achart.chart.SeriesCollection[1].values:='总!$B$31:$B$45';
achart.chart.seriescollection[2].name:='坐标轴说明2';
achart.chart.SeriesCollection[2].values:='总!$B$31:$B$45';
achart.Chart.HasTitle:=True;
achart.Chart.ChartTitle.Characters.Text:='Excle二维图';
achart.Chart.ChartTitle.Font.size:=16;
achart.Chart.PlotArea.Left:=10;
achart.Chart.PlotArea.Width:=423;
achart.Chart.PlotArea.Height:=908;
msexcel.visible:=true;
msexcelworksheet:=null;
msexcelworkbook:=null;
msexcel:=null;
end;
end;
achart.chart.SetSourceData('sheet1!$A$31:$B$47',2);
这些语句应该如何表示?
用achart.chart.seriescollection.add('=sheet1!R31C1:R44C1',true)这个语句执行后没有效果.望高手指点指点.
var
filename:string;
msexcel:variant;
msexcelworkbook:variant;
msexcelworksheet,achart:variant;
begin
filename:='C:/PO统计复件12.xls';
if filename<>'' then
begin
msexcel:=createoleobject('Excel.application');
msexcelworkbook:=msexcel.workbooks.open(filename);
msexcelworksheet:=msexcel.workbooks[1].worksheets[1];
msexcelworksheet.Activate;
achart:=msexcelworksheet.chartobjects.add(100,100,800,300);
achart.chart.charttype:=51;
achart.chart.SetSourceData('sheet1!$A$31:$B$47',2);
achart.chart.seriescollection.NewSeries;
achart.chart.seriescollection.NewSeries;
achart.chart.SeriesCollection[1].name:='坐标轴说明1';
achart.chart.SeriesCollection[1].values:='总!$B$31:$B$45';
achart.chart.seriescollection[2].name:='坐标轴说明2';
achart.chart.SeriesCollection[2].values:='总!$B$31:$B$45';
achart.Chart.HasTitle:=True;
achart.Chart.ChartTitle.Characters.Text:='Excle二维图';
achart.Chart.ChartTitle.Font.size:=16;
achart.Chart.PlotArea.Left:=10;
achart.Chart.PlotArea.Width:=423;
achart.Chart.PlotArea.Height:=908;
msexcel.visible:=true;
msexcelworksheet:=null;
msexcelworkbook:=null;
msexcel:=null;
end;
end;
achart.chart.SetSourceData('sheet1!$A$31:$B$47',2);
这些语句应该如何表示?
用achart.chart.seriescollection.add('=sheet1!R31C1:R44C1',true)这个语句执行后没有效果.望高手指点指点.