delphi生成excle三维饼图,帮帮忙 delphi生成excle三维饼图,帮帮忙,我可以生成三维的饼图,但我得到的是一个属性对应的整个图。我想要多个属性把此图根据他们所占的比重,分配。帮帮忙,挣了一下午了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不会,帮你顶一下.(没试过用EXCEL做三维图.呵呵,如果你会用VB脚本编出的话,应该能转成DELPHI的)不然,你得查到三维图的相关函数(EXCEL) 这个是我写的一部分代码,希望有帮助 achart1 := Excelid.worksheets[ImagePage].chartobjects.add(leftPostion,topPostion,widthPostion,heightPostion); achart1.chart.charttype := xl3DPieExploded;//xl3DPie ; //生成何种类型的图 //设置x轴、y轴数据 cell1 := Excelid.worksheets[dataPage].Cells[ExRowsName,1]; cell2 := Excelid.worksheets[dataPage].Cells[ExRowsName,ExClos-1]; cell3 := Excelid.worksheets[dataPage].Cells[ExRowsValue,1]; cell4 := Excelid.worksheets[dataPage].Cells[ExRowsValue,ExClos-1]; Range1 := Excelid.worksheets[dataPage].Range[cell1, cell2]; //设定Chart类别坐标轴(x轴)的取值区域 Range2 := Excelid.worksheets[dataPage].Range[cell3, cell4]; //设定Chart数值坐标轴(y轴)的取值区域 series1:= achart1.chart.seriescollection ; //series1.add (Range2,xlColumns,false); //设置y轴的数据 series1.add (Range2,true); //可以使用,能够生成饼图 //achart1.chart.seriescollection[1].name:='nihao'; //设置饼图的形式 achart1.chart.seriescollection[1].ApplyDataLabels(xlDataLabelsShowLabelAndPercent,true,true,true); achart1.Chart.Axes[xlCategory].CategoryNames := Range1; //设置x轴数据 //series1.add (Range2,xlColumns,false); //设置y轴的数据 //achart1.Chart.Axes[xlCategory].CategoryNames := Range1; //设置x轴数据 //删除右侧的标题 achart1.Chart.Legend.delete; //添加图表标题 achart1.Chart.HasTitle:=True; achart1.Chart.ChartTitle.Characters.Text:=CheckListBoxPOTT.Items[i]; achart1.Chart.HasLegend:=true; achart1.Chart.Legend.Position := xlBottom; delphi 谁有使用quickreport控件的源代码? 关于一个动态创建控件的问题 open;//為什麼要使用open才可以在dbgrid1顯示table1的數據? 古老的问题:建立一个visual foxpro的 dbf,帮帮忙呀 计算公式是动态变化???? 如何获取当前获得焦点的控件名称 大家帮帮我看看这个DBGrid的问题怎么解决呀? Excel导入MSSQL难题 DELPHI程序如何发布 怎么打开文件后缀是ICL的图标库? Delphi的Enterprise 和 C/S版有什么区别 关于的窗口句柄的问题!
//设置x轴、y轴数据
cell1 := Excelid.worksheets[dataPage].Cells[ExRowsName,1];
cell2 := Excelid.worksheets[dataPage].Cells[ExRowsName,ExClos-1];
cell3 := Excelid.worksheets[dataPage].Cells[ExRowsValue,1];
cell4 := Excelid.worksheets[dataPage].Cells[ExRowsValue,ExClos-1]; Range1 := Excelid.worksheets[dataPage].Range[cell1, cell2]; //设定Chart类别坐标轴(x轴)的取值区域 Range2 := Excelid.worksheets[dataPage].Range[cell3, cell4]; //设定Chart数值坐标轴(y轴)的取值区域 series1:= achart1.chart.seriescollection ;
//series1.add (Range2,xlColumns,false); //设置y轴的数据
series1.add (Range2,true); //可以使用,能够生成饼图
//achart1.chart.seriescollection[1].name:='nihao';
//设置饼图的形式
achart1.chart.seriescollection[1].ApplyDataLabels(xlDataLabelsShowLabelAndPercent,true,true,true);
achart1.Chart.Axes[xlCategory].CategoryNames := Range1; //设置x轴数据 //series1.add (Range2,xlColumns,false); //设置y轴的数据
//achart1.Chart.Axes[xlCategory].CategoryNames := Range1; //设置x轴数据
//删除右侧的标题
achart1.Chart.Legend.delete; //添加图表标题
achart1.Chart.HasTitle:=True;
achart1.Chart.ChartTitle.Characters.Text:=CheckListBoxPOTT.Items[i];
achart1.Chart.HasLegend:=true;
achart1.Chart.Legend.Position := xlBottom;