C# OWC11
public void OcwChart(int[] Data,string[] DataName,string Yname,string Xname,string ChartName,string Dname)
{
try
{
//创建ChartSpace对象
ChartSpaceClass mySpace = new ChartSpaceClass();
//添加图表
ChChart ChartMonth = mySpace.Charts.Add(0);
//指定图表类型
ChartMonth.Type = ChartChartTypeEnum.chChartTypeColumnClustered;
// ChartMonth.Type = ChartChartTypeEnum.chChartTypeLineMarkers;
ChartMonth.HasTitle = true;
ChartMonth.HasLegend = true;
ChartMonth.Title.Font.Bold = true;
ChartMonth.Title.Font.Size = 12;
ChartMonth.Title.Font.Color = "#ff3300";
ChartMonth.Axes[0].HasTitle = true;
//横轴名称
ChartMonth.Axes[0].Title.Caption = Xname;
ChartMonth.Axes[1].HasTitle = true;
//纵轴名称
ChartMonth.Axes[1].Title.Caption = Yname;
ChartMonth.Axes[0].Title.Font.Bold = true;
ChartMonth.Axes[0].Title.Font.Color = "#995540";
ChartMonth.Axes[1].Title.Font.Bold = true;
ChartMonth.Axes[1].Title.Font.Color = "#994400";
//图表名称
ChartMonth.Title.Caption = ChartName;
////生成横轴的名称
//int data_i = 0;
//for (int i = 0; i < 6; i++)
//{
// DataName[data_i] = string.Format("{0:" + string.Format("{0:D2}", i) + "\r\n月\r\n" + "}", (i + 1).ToString());
// data_i++;
//}
string strValue = "";
string strCateory = "";
//将数据格式化
for (int i = 0; i < DataName.Length; i++)
{
strCateory += DataName[i] + '\t';
}
for (int i = 0; i < Data.Length; i++)
{
strValue += Data[i].ToString() + '\t';
}
//添加序列
ChartMonth.SeriesCollection.Add(0);
ChartMonth.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimSeriesNames, (int)ChartSpecialDataSourcesEnum.chDataLiteral, Dname);
ChartMonth.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimCategories, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strCateory);
ChartMonth.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimValues, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strValue);
//输出图表
string strAbsolutePath = Application.StartupPath + @"\rate.gif";
// mySpace.ExportPicture(strAbsolutePath, "GIF", pictureBox1.Width, pictureBox1.Height);
// pictureBox1.ImageLocation = strAbsolutePath;
}
catch (Exception ex)
{
MessageBox.Show("流量图显示错误:" + ex.Message);
}
}
C# OWC11的更多相关文章
- AxMicrosoft.Office.Interop.Owc11.AxSpreadsheet控件在C#中的引用
这几天要是用AxMicrosoft.Office.Interop.Owc11.AxSpreadsheet控件做查询,发现一系列问题,一点点记录下来吧,以备后查: 第一.相关属性:http://www. ...
- OWC11生成统计图案例
(1)饼状图:----通过修改参数生成不同的走势图, string strCategory = "优良率" + '\t' + "合格率" + '\t' + &q ...
- C# Microsoft.Office.Interop.Owc11 导出excel文件
C# Microsoft.Office.Interop.Owc11 导出excel文件 1.新建项SupremeWindowsForms窗体应用项目(项目平台设置称X86) 注意:因为大多数第三方写的 ...
- [转]SSAS没有注册类 (异常来自 HRESULT:0x80040154 (REGDB_E_CLASSNOTREG)) (Microsoft Visual Studio)的解决办法
转自:http://www.cnblogs.com/xvqm00/archive/2011/07/15/2107338.html 打开SSAS 数据源视图浏览数据时,提示 没有注册类别 (异常来自 H ...
- SharePoint 2013 运行在IIS 应用32位错误
问题描述: 今天有一个项目因为用了OWC11,没有64位的dll,因此IIS设置了“启用32位应用程序”为true. 如图: 详细操作见:http://www.cnblogs.com/cainiaog ...
- 【Excel】Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046}:
[Excel]Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000 ...
- [转] C#操作EXCEL,生成图表的全面应用
gailzhao 原文 关于C#操作EXCEL,生成图表的全面应用 近来我在开发一个运用C#生成EXCEL文档的程序,其中要根据数据生成相应的图表,该图表对颜色和格式都有严格的要求,在百度和谷歌中搜索 ...
- OWC控件的使用
环境:SQL Server 2005 Analysis Services + OWC 1.1 +Win 7 准备: 1.在SQL Server 2005 Analysis Services建好ola ...
- Chart图形 [GDI+] OWCChart统计图的封装类 (转载)
点击下载 OWCChart.zip 利用OWC11进行作统计图的封装类. /// <summary> /// 类说明:进行作统计图的封装类 /// 联系方式:361983679 /// 更 ...
随机推荐
- LeetCode(2)---路径总和
给定一个二叉树和一个目标和,判断该树中是否存在根节点到叶子节点的路径,这条路径上所有节点值相加等于目标和. 说明: 叶子节点是指没有子节点的节点. 示例: 给定如下二叉树,以及目标和 sum = ...
- 【SCOI2008】奖励关 题解(状压DP+期望)
题目链接 题目大意:给定$n$个宝物,每次随机抛出一个宝物,奖励分数为$p_i$.但如果选这个宝物必须选过它的前置宝物集合.共进行$K$轮问最优策略下的期望. $n\leq 15,-10^6\leq ...
- DeepVO: Towards End-to-End Visual Odometry with Deep Recurrent Convolutional Neural Networks
1.Introduction DL解决VO问题:End-to-End VO with RCNN 2.Network structure a.CNN based Feature Extraction 论 ...
- 对Word2Vec的理解
1. word embedding 在NLP领域,首先要把文字或者语言转化为计算机能处理的形式.一般来说计算机只能处理数值型的数据,所以,在NLP的开始,有一个很重要的工作,就是将文字转化为数字,把这 ...
- 创建shell脚本文件
简单来说脚本就是将需要执行的命令保存到文本中,按照顺序(由上往下执行),它是解释型的,不需要 编译 脚本格式 #!/bin/bash或者#!/bin/env bash开头 第一个shell脚本:hel ...
- JS学习第四天
循环语句 while(){ }: while :先判断再执行,如果while的条件结果为false,那么执行语句块中代码一句都不走 do(){ }while; do while:先执行代码块中的语 ...
- 2020-04-05:谈一下spring事务传播
- 【ZJOI2012】灾难 - LCA+拓扑排序
题目描述 阿米巴是小强的好朋友. 阿米巴和小强在草原上捉蚂蚱.小强突然想,如果蚂蚱被他们捉灭绝了,那么吃蚂蚱的小鸟就会饿死,而捕食小鸟的猛禽也会跟着灭绝,从而引发一系列的生态灾难. 学过生物的阿米巴告 ...
- 一句话木马变形(截止2020年8月16日通杀D盾、安全狗,微步,webshellKiller)
首先一句话木马: <?php assert($_POST['a']); ?> D盾扫描,5级 分开写: <?php $a = "assert"; $b = $_P ...
- 微信access token过期
两台服务器使用同一个微信账号(同一个app id) 时,当其中一台服务器向微信请求access token时,会造成另一台服务器的access token过期