Aspose.Word for Net Word模板使用书签实现插入图表
2021-01-17 20:12
标签:mamicode system example save arp raw 图表 名称 builder 一:创建模板 二:图表Docment构建 三:使用 效果: Aspose.Word for Net Word模板使用书签实现插入图表 标签:mamicode system example save arp raw 图表 名称 builder 原文地址:https://www.cnblogs.com/lzme/p/13359856.html public Document chart()
{
var doc = new Document();
var builder = new DocumentBuilder(doc);
var shape = builder.InsertChart(Aspose.Words.Drawing.Charts.ChartType.Column, 432, 252);
var chart = shape.Chart;
var seriescoll = chart.Series;
seriescoll.Clear();
//Create category names array, in this example we have two categories.
//创建类别名称数组,在此示例中我们有两个类别。
string[] categories = { "第一赛季", "第二赛季", "第三赛季" };
//添加新系列。数据数组不能为空,并且数组的大小必须相同。
seriescoll.Add("AW Series 1", categories, new double[] { 1, 2, 2 });
seriescoll.Add("AW Series 2", categories, new double[] { 3, 4, 44 });
seriescoll.Add("AW Series 3", categories, new double[] { 5, 6, 22 });
seriescoll.Add("AW Series 4", categories, new double[] { 7, 81, 3 });
seriescoll.Add("AW Series 5", categories, new double[] { 9, 10, 44 });
return doc;
}
Document doc = new Document(Server.MapPath(path));
builder.InsertDocument(chart(),ImportFormatMode.UseDestinationStyles);
doc.Save(System.Web.HttpContext.Current.Response, "C00.doc", ContentDisposition.Attachment, null);
文章标题:Aspose.Word for Net Word模板使用书签实现插入图表
文章链接:http://soscw.com/index.php/essay/43337.html