可不可以让“柱状图”导到EXCEL里 在程序里有图型的统计,能不能导出到EXCEL里? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 进入Excel,单击工具/宏/Visual Basic 编辑器,然后在打开的窗口,单击帮助,查询相应的VBA语句即可。 使用Delphi 控制Excle二维图在Form中分别放入ExcelApplication, ExcelWorkbook和ExcelWorksheetvar asheet1,achart, range:variant;1)选择当第一个工作薄第一个工作表asheet1:=ExcelApplication1.Workbooks[1].Worksheets[1];2)增加一个二维图achart:=asheet1.chartobjects.add(100,100,200,200);3)选择二维图的形态achart.chart.charttype:=4;4)给二维图赋值series:=achart.chart.seriescollection;range:=sheet1!r2c3:r3c9;series.add(range,true);5)加上二维图的标题achart.Chart.HasTitle:=True;achart.Chart.ChartTitle.Characters.Text:=’ Excle二维图’ 6)改变二维图的标题字体大小achart.Chart.ChartTitle.Font.size:=6;7)给二维图加下标说明achart.Chart.Axes(xlCategory, xlPrimary).HasTitle := True;achart.Chart.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text := '下标说明';8)给二维图加左标说明achart.Chart.Axes(xlValue, xlPrimary).HasTitle := True;achart.Chart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text := '左标说明';9)给二维图加右标说明achart.Chart.Axes(xlValue, xlSecondary).HasTitle := True;achart.Chart.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text := '右标说明';10)改变二维图的显示区大小achart.Chart.PlotArea.Left := 5;achart.Chart.PlotArea.Width := 223;achart.Chart.PlotArea.Height := 108;11)给二维图坐标轴加上说明achart.chart.seriescollection[1].NAME:='坐标轴说明'; 是这个意思,图是根据数据库里的相关数据形成的,想在导出时把图导出来放到EXCEL里。 delphi菜单项过多结果显示不全,想分列或者加上下滚动箭头 如何自动生成Button控件? 用TWebConnection启动的应用服务器端怎么读写注册表? fastreport打印老是显示白板一张?????????????????? 连新手都会笑我的问题,可是求知总无罪呀!帮帮忙! 很急的查询问题,望高手进来看一看 Help? 请教关于字符串操作的方法 如何得到DBGridEh的每一column的title.caption呀? lcase(我是小菜)你在吗?想向您讨教一下安装文件的制作!欢迎用过installshield的同志指教! 请问怎样取消用户的click事件? 郁闷,散分。
在Form中分别放入ExcelApplication, ExcelWorkbook和ExcelWorksheet
var asheet1,achart, range:variant;
1)选择当第一个工作薄第一个工作表
asheet1:=ExcelApplication1.Workbooks[1].Worksheets[1];
2)增加一个二维图
achart:=asheet1.chartobjects.add(100,100,200,200);
3)选择二维图的形态
achart.chart.charttype:=4;
4)给二维图赋值
series:=achart.chart.seriescollection;
range:=sheet1!r2c3:r3c9;
series.add(range,true);
5)加上二维图的标题
achart.Chart.HasTitle:=True;
achart.Chart.ChartTitle.Characters.Text:=’ Excle二维图’
6)改变二维图的标题字体大小
achart.Chart.ChartTitle.Font.size:=6;
7)给二维图加下标说明
achart.Chart.Axes(xlCategory, xlPrimary).HasTitle := True;
achart.Chart.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text := '下标说明';
8)给二维图加左标说明
achart.Chart.Axes(xlValue, xlPrimary).HasTitle := True;
achart.Chart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text := '左标说明';
9)给二维图加右标说明
achart.Chart.Axes(xlValue, xlSecondary).HasTitle := True;
achart.Chart.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text := '右标说明';
10)改变二维图的显示区大小
achart.Chart.PlotArea.Left := 5;
achart.Chart.PlotArea.Width := 223;
achart.Chart.PlotArea.Height := 108;
11)给二维图坐标轴加上说明
achart.chart.seriescollection[1].NAME:='坐标轴说明';