当前位置: 首页 > news >正文

可以在几个 网站备案定制网站设计方案

可以在几个 网站备案,定制网站设计方案,网站流量方案,郑州校园兼职网站建设图表#xff0c;是指将既得数据用图形的方式表示出来。在前文中我们介绍过如何使用Java程序来为Excel文档创建图表的方法。本文将通过使用Java程序来演示如何创建PowerPoint图表及为图表添加趋势线。趋势线的运用能够显示数据的变化趋势#xff0c;同时能够帮助预测数据的未来…图表是指将既得数据用图形的方式表示出来。在前文中我们介绍过如何使用Java程序来为Excel文档创建图表的方法。本文将通过使用Java程序来演示如何创建PowerPoint图表及为图表添加趋势线。趋势线的运用能够显示数据的变化趋势同时能够帮助预测数据的未来值。Jar文件获取及导入方法1通过官网下载获取jar包。解压后将lib文件夹下的Spire.Presentation.jar文件导入Java程序。(如下图)方法2通过maven仓库安装导入。具体安装教程参见此网页。【示例1】创建图表import com.spire.presentation.*;import com.spire.pdf.tables.table.*;import com.spire.presentation.charts.*;import com.spire.presentation.drawing.FillFormatType;import java.awt.geom.Rectangle2D;import java.lang.Object;public class AddChart {public static void main(String[] args) throws Exception {//实例化一个Presentation对象Presentation presentation new Presentation();//插入柱形图Rectangle2D.Double rect new Rectangle2D.Double(40, 100, 550, 320);IChart chart null;chart presentation.getSlides().get(0).getShapes().appendChart(ChartType.COLUMN_CLUSTERED, rect);//添加表名chart.getChartTitle().getTextProperties().setText(销售报表);chart.getChartTitle().getTextProperties().isCentered(true);chart.getChartTitle().setHeight(30);chart.hasTitle(true);//创建后台数据表DataTable dataTable new DataTable();dataTable.getColumns().add(new DataColumn(销售额, DataTypes.DATATABLE_STRING));dataTable.getColumns().add(new DataColumn(谷物, DataTypes.DATATABLE_INT));dataTable.getColumns().add(new DataColumn(粮油, DataTypes.DATATABLE_INT));dataTable.getColumns().add(new DataColumn(百货, DataTypes.DATATABLE_INT));DataRow row1 dataTable.newRow();row1.setString(销售额, 门店1);row1.setInt(谷物, 250);row1.setInt(粮油, 150);row1.setInt(百货, 99);DataRow row2 dataTable.newRow();row2.setString(销售额, 门店2);row2.setInt(谷物, 270);row2.setInt(粮油, 150);row2.setInt(百货, 99);DataRow row3 dataTable.newRow();row3.setString(销售额, 门店3);row3.setInt(谷物, 310);row3.setInt(粮油, 120);row3.setInt(百货, 49);DataRow row4 dataTable.newRow();row4.setString(销售额, 门店4);row4.setInt(谷物, 330);row4.setInt(粮油, 120);row4.setInt(百货, 49);DataRow row5 dataTable.newRow();row5.setString(销售额, 门店5);row5.setInt(谷物, 360);row5.setInt(粮油, 150);row5.setInt(百货, 141);DataRow row6 dataTable.newRow();row6.setString(销售额, 门店6);row6.setInt(谷物, 380);row6.setInt(粮油, 150);row6.setInt(百货, 135);dataTable.getRows().add(row1);dataTable.getRows().add(row2);dataTable.getRows().add(row3);dataTable.getRows().add(row4);dataTable.getRows().add(row5);dataTable.getRows().add(row6);//将数据写入图表for (int c 0; c dataTable.getColumns().size(); c) {chart.getChartData().get(0, c).setText(dataTable.getColumns().get(c).getColumnName());}for (int r 0; r dataTable.getRows().size(); r) {Object[] datas dataTable.getRows().get(r).getArrayList();for (int c 0; c datas.length; c) {chart.getChartData().get(r 1, c).setValue(datas[c]);}}//设置系列标签chart.getSeries().setSeriesLabel(chart.getChartData().get(B1, D1));//设置类别标签chart.getCategories().setCategoryLabels(chart.getChartData().get(A2, A7));//为各个系列赋值chart.getSeries().get(0).setValues(chart.getChartData().get(B2, B7));chart.getSeries().get(1).setValues(chart.getChartData().get(C2, C7));chart.getSeries().get(2).setValues(chart.getChartData().get(D2, D7));chart.getSeries().get(2).getFill().setFillType(FillFormatType.SOLID);chart.getSeries().get(2).getFill().getSolidColor().setKnownColor(KnownColors.LIGHT_BLUE);//设置系列重叠chart.setOverLap(-50);//设置类别间距chart.setGapDepth(200);//保存文档presentation.saveToFile(output/CreateChart.pptx, FileFormat.PPTX_2010);}}创建效果【示例2】为图表添加趋势线import com.spire.presentation.FileFormat;import com.spire.presentation.ISlide;import com.spire.presentation.Presentation;import com.spire.presentation.charts.IChart;import com.spire.presentation.charts.ITrendlines;import com.spire.presentation.charts.TrendlineSimpleType;public class AddTrendline {public static void main(String[] args) throws Exception {//创建Presentation实例Presentation ppt new Presentation();//加载PowerPoint文档ppt.loadFromFile(C:\\Users\\Test1\\Desktop\\CreateChart.pptx);//获取第一张幻灯片ISlide slide ppt.getSlides().get(0);//获取幻灯片上的图表IChart chart (IChart)slide.getShapes().get(0);//给图表的第一个数据系列添加线性趋势线ITrendlines trendLine chart.getSeries().get(0).addTrendLine(TrendlineSimpleType.LINEAR);//不显示公式//trendLine.setdisplayEquation(false);//不显示R平方值//trendLine.setdisplayRSquaredValue(false);//保存结果文档ppt.saveToFile(output/AddTrendline.pptx, FileFormat.PPTX_2013);}}添加效果(本文完)
http://www.pierceye.com/news/395598/

相关文章:

  • php网站开发实施方案福建建筑信息平台
  • 怎么写公司网站的文案建设网站技术公司简介
  • 陕西做网站的wordpress增加变量
  • 莒南县建设工程网站网站认证方式有几种
  • 举报网站建设自查报告相同网站名
  • 网站建设网站建设公司北京logo设计制作
  • 福州市交通建设集团有限公司 网站全国国家公示系统官网
  • 郑州网站建设蝶动2023年专升本最新政策
  • 江苏网站推广网络企业宣传画册设计公司
  • 沈阳设计网站公司哪家好个人养老保险怎么交费
  • 烟台seo网站推广如何给自己公司设计logo
  • wordpress 图片大小设置梧州网站优化公司
  • 360推广 网站建设豫建设标去哪个网站
  • 职高网站建设知识点国家免费技能培训有哪些
  • 哪个网站有帮忙做公开课课件怎么查那些人输入做网站
  • 怎么做qq钓鱼网站吗有哪些站内推广的方式
  • wap手机网站建设校园论坛网站怎么做
  • 北京专业网站的建设滨州做网站的
  • 网站点击排名wordpress 联系我们
  • 上街免费网站建设seo外包公司优化
  • 营销型网站的三大特点安徽网站设计方案
  • 优化网站推广教程排名做微信公众号页面的网站
  • 龙岗网站设计效果台州百度关键词排名
  • 政务类网站建设ps做全屏网站画布要多大
  • 百度广告搜索推广seo如何快速排名百度首页
  • 网站调用微信数据网站开发语言windows
  • 网站建设的公青岛专业网站制作设计
  • 东莞营销型网站学动漫设计有前途吗
  • 资讯网站wordpress实例配置
  • 营销网站建设哪里便宜最新房地产新闻