转载:

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. input 数字输入控制(含小数)

    1,可以在keypress里验证输入的字符的合法性. // 数字控件的入力控制 $("input.comma,input.comma1,input.comma2").keypres ...

  2. nginx 4层tcp代理获取真实ip

    举个例子,Nginx 中的代理配置假如是这样配置的: location / { proxy_http_version 1.1; proxy_set_header X-Real-IP $remote_a ...

  3. How get a String Width in Libgdx?

    http://stackoverflow.com/questions/16600547/how-get-a-string-width-in-libgdx

  4. JS DOM操作思维导图

  5. Html5學習重點清單

    SVG webSQL 數據庫 SSE 服務推送 MathML 基於xml語法 Web 存储 webSockets通信 canvas 畫布操作 音頻和視頻 地理位置 Geolocation API We ...

  6. sparkR集群启动脚本的封装。

    sparkR默认是以单机方式运行的.实现sparkR的集群启动,需要指定master地址,占用内存.CPU,及UI端口等,这对分析人员来说是比较麻烦的. 如何实现对其启动的封装,方便分析人员来使用: ...

  7. Development Tools

    Introduction Even Chris created his article of Useful Reference Books ages ago I just bumped into it ...

  8. (笔记)Mysql命令insert into:向表中插入数据(记录)

    insert into命令用于向表中插入数据. insert into命令格式:insert into <表名> [(<字段名1>[,..<字段名n > ])] v ...

  9. Cisco交换机配置VLAN

    Cisco IOS中有两种方式创建vlan,在全局模式下使用vlan vlanid命令,如switch(config)#vlan 10; 在vlan database 下创建vlan ,如 switc ...

  10. 10个样式各异的CSS3 Loading加载动画

    前几天我在园子里分享过2款很酷的CSS3 Loading加载动画,今天又有10个最新的Loading动画分享给大家,这些动画的样式都不一样,实现起来也并不难,你很容易把它们应用在项目中,先来看看效果图 ...