转载:

http://www.cnblogs.com/muer/p/yaxle.html

代码:

public ActionResult ImportData(HttpPostedFileBase file)
{
  Workbook workbook = new Workbook();
  Worksheet sheet = workbook.Worksheets[];   Cells cells = sheet.Cells;
  cells[, ].PutValue("Income");
  cells[, ].PutValue("Expense");
  cells[, ].PutValue("Company A");
  cells[, ].PutValue("Company B");
  cells[, ].PutValue("Company C");
  cells[, ].PutValue();
  cells[, ].PutValue();
  cells[, ].PutValue();
  cells[, ].PutValue();
  cells[, ].PutValue();
  cells[, ].PutValue();   int chartIndex = sheet.Charts.Add(ChartType.Column, , , , );   Aspose.Cells.Charts.Chart chart = sheet.Charts[chartIndex];   //第一条柱子
  chart.NSeries.Add("B2:B4", true);
  chart.NSeries.CategoryData = "A2:A4";
  Series aSeries1 = chart.NSeries[];
  aSeries1.Name = "=B1";
  chart.NSeries.IsColorVaried = true;
  //第二条柱子
  chart.NSeries.Add("C2:C4", true);
  chart.NSeries.CategoryData = "A2:A4";
  Series aSeries2 = chart.NSeries[];
  aSeries2.Name = "=C1";
  //修改柱子颜色
  aSeries2.Area.ForegroundColor = System.Drawing.Color.Green;   //修改柱形图背景色
  chart.PlotArea.Area.ForegroundColor = System.Drawing.Color.FromArgb(, , , );
  //修改区域背景色
  chart.ChartArea.Area.ForegroundColor = System.Drawing.Color.White;
  //显示数据表
  chart.ShowDataTable = true;
  //显示分类条
  chart.ShowLegend = true;
  chart.Title.Text = "Income Analysis";
  workbook.Save(path);
  return null;
}

C#------Aspose.cells使用方法的更多相关文章

  1. Aspose.Cells设置自动列宽(最佳列宽)及一些方法总结

    /// <summary> /// 设置表页的列宽度自适应 /// </summary> /// <param name="sheet">wor ...

  2. C# 读写Excel的一些方法,Aspose.Cells.dll

    需求:现有2个Excel,一个7000,一个20W,7000在20W是完全存在的.现要分离20W的,拆分成19W3和7000. 条件:两个Excel都有“登录名”,然后用“登录名”去关联2个Excel ...

  3. 使用Aspose.Cells生成Excel的方法详解(转)

    using System; using System.Collections.Generic;  using System.Linq;  using System.Web;  using System ...

  4. Aspose.Cells基础使用方法整理

    Aspose.Cells 插件,将web端数据以excel形式导出到客户端. 相关文档: https://blog.csdn.net/djk8888/article/details/53065416 ...

  5. C# WinForm 导出导入Excel/Doc 完整实例教程[使用Aspose.Cells.dll]

    [csharp] view plain copy 1.添加引用: Aspose.Cells.dll(我们就叫工具包吧,可以从网上下载.关于它的操作我在“Aspose.Cells操作说明 中文版 下载 ...

  6. NPOI、MyXls、Aspose.Cells 导入导出Excel(转)

    Excel导入及导出问题产生: 从接触.net到现在一直在维护一个DataTable导s出到Excel的类,时不时还会维护一个导入类.以下是时不时就会出现的问题: 导出问题: 如果是asp.net,你 ...

  7. 使用Aspose.Cells 根据模板生成excel里面的 line chart

    目的: 1.根据模板里面的excel数据信息,动态创建line chart 2.linechart 的样式改为灰色 3.以流的形式写到客户端,不管客户端是否装excel,都可以导出到到客户端 4.使用 ...

  8. 使用Aspose.Cells组件生成Excel文件

    生成带表头的Excel文件,格式如下显示. 当然更复杂的一些也可以通过 合并单元格的方法 public void Merge(int firstRow, int firstColumn, int to ...

  9. C# WinForm使用Aspose.Cells.dll 导出导入Excel/Doc 完整实例教程

    1.添加引用: Aspose.Cells.dll(我们就叫工具包吧,可以从网上下载.关于它的操作我在“Aspose.Cells操作说明 中文版 下载 Aspose C# 导出Excel 实例”一文中的 ...

随机推荐

  1. destoon 添加一个新的模块

    根目录rename,中config.inc.php文件/module/rename下两个文件,my.inc.php ,rename.class.php/module/rename/admin/三个文件 ...

  2. Extjs4.2 Grid搜索Ext.ux.grid.feature.Searching的使用

    背景 Extjs4.2 默认提供的Search搜索,功能还是非常强大的,只是对于国内的用户来说,还是不习惯在每列里面单击好几下再筛选,于是相当当初2.2里面的搜索,更加的实用点,于是在4.2里面实现. ...

  3. linux 常见错误

    yum.pid 已被锁定 rm -rf /var/run/yum.pid

  4. struts2+hibernate(分页实现)

    //Dao类中实现了list集合和pagetotal方法 package zjf.strhib.Dao; import java.util.ArrayList; import java.util.Li ...

  5. 定制应用Repeater 、ListView的模版

    若干年前有个需求:客户可在管理后台给每个新闻内容栏目指定新闻的显示样式,有的可以显示新闻时间,有的则不需要.于是就有了动态模版的应用.记得当时是用 LoadControl 的方式然后 Controls ...

  6. ClassNotFoundException和NoClassDefFoundError的解决办法

    程序在其他手机都没有问题,但在刷到版本稍微较低的平板或手机上时就会直接闪退,并报出以下异常: java.lang.RuntimeException: Unable to instantiate act ...

  7. sparkr脚本

    test <- function(){ print(1) } test() 脚本内为单独函数时 调用脚本不执行 所以要在脚本内调取特定函数

  8. [kafka] 005_kafka_Java_API

    1.生产者Producer 1)添加依赖 <dependency> <groupId>org.apache.kafka</groupId> <artifact ...

  9. tensorflow 模型前向传播 保存ckpt tensorbard查看 ckpt转pb pb 转snpe dlc 实例

    参考: TensorFlow 自定义模型导出:将 .ckpt 格式转化为 .pb 格式 TensorFlow 模型保存与恢复 snpe tensorflow 模型前向传播 保存ckpt  tensor ...

  10. IDEA MAVEN Failed to create a Maven project 'C:/gitProjects/mayProj/pom.xml' already exists in VFS

    When adding the module to an existing module that already has a POM, it is necessary to manually spe ...