读书人

不能设置类chartarea的height属性,该怎

发布时间: 2012-03-30 17:32:09 作者: rapoo

不能设置类chartarea的height属性
我用delphi导出excel饼图,想设置 ChartArea,与PlotArea大小,
但是设置ChartArea的长宽时
ExlApp.ActiveChart.ChartArea.height := 166;
ExlApp.ActiveChart.ChartArea.width := 268;
提示不能设置类chartarea的height属性?
需要设置什么属性才能设置chartarea的height的值吗?



[解决办法]
你一段宏看看在VBA面有有具的事件、性或方法;如果在不行 ,可以著其EelApp或Sheet或Worksheet呢。。。段代,你好好研究研究.......

Delphi(Pascal) code
...........oResizeRange := ExApp.Range[Sht.Cells.Item[RowBegin2,1],Sht.Cells.Item[RowBegin2+tslwork.count-1,2+tslprod.count]];  oChart := Sht.Parent.Charts.Add;  oChart.ChartWizard(oResizeRange,xlline,xlRows);  oChart.ChartArea.AutoScaleFont := False;  oChart.ChartArea.Font.Name := 'ËÎÌå';  oChart.ChartArea.Font.FontStyle := 'Regular';  oChart.ChartArea.Font.Size := 9;  oChart.PlotBy:=xlcolumns ;  if cdsfinal.RecordCount>0 then  begin    for i:=0 to tslprod.count-1 do    begin       ochart.seriescollection(i+1).name := 'Prod '+tslprod.strings[i];       if  RadioButton1.Checked=true then       oChart.SeriesCollection(i+1).ChartType := xlColumnClustered ;    end;    ochart.seriescollection(tslprod.count+1).name := 'AVG';  end;  oChart.Location(xlLocationAsObject,Sht.Name);   j:=1;   Sht.Shapes.Item(j).Top := Sht.Rows.Item[Rowbegin2-1].Top;   Sht.Shapes.Item(j).Left := Sht.Columns.Item[1].Left;   Sht.Shapes.Item(j).Width := '700';   Sht.Shapes.Item(j).Height :=260;........... 

读书人网 >.NET

热点推荐