不能设置类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呢。。。給段測試代碼,你好好研究研究.......
...........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;...........