zoukankan
html css js c++ java
owc11生成饼状图
using
System;
using
System.Collections;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Web;
using
System.Web.SessionState;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.HtmlControls;
using
OWC11;
namespace
WebApplication1
{
/**/
///
<summary>
///
WebForm3 的摘要说明。
///
</summary>
public
class
WebForm3 : System.Web.UI.Page
{
protected
System.Web.UI.WebControls.PlaceHolder ChartHolder;
private
void
Page_Load(
object
sender, System.EventArgs e)
{
//
在此处放置用户代码以初始化页面
//
创建ChartSpace对象来放置图表
OWC11.ChartSpace objCSpace
=
new
OWC11.ChartSpaceClass ();
//
在ChartSpace对象中添加图表,Add方法返回chart对象
OWC11.ChChart objChart
=
objCSpace.Charts.Add (
0
);
//
指定图表的类型。类型由OWC11.ChartChartTypeEnum枚举值得到
objChart.Type
=
OWC11.ChartChartTypeEnum.chChartTypePie ;
//
指定图表是否需要图例
objChart.HasLegend
=
true
;
//
给定标题
objChart.HasTitle
=
true
;
objChart.Title.Caption
=
"
上半年分布图
"
;
//
计算数据
//
categories 和 values 可以用tab分割的字符串来表示*/
string
strSeriesName
=
"
图例 1
"
;
string
strCategory
=
"
1
"
+
'
\t
'
+
"
2
"
+
'
\t
'
+
"
3
"
+
'
\t
'
+
"
4
"
+
'
\t
'
+
"
5
"
+
'
\t
'
+
"
6
"
+
'
\t
'
;
string
strValue
=
"
9
"
+
'
\t
'
+
"
8
"
+
'
\t
'
+
"
4
"
+
'
\t
'
+
"
10
"
+
'
\t
'
+
"
12
"
+
'
\t
'
+
"
6
"
+
'
\t
'
;
//
添加一个series
objChart.SeriesCollection.Add(
0
);
//
给定series的名字
objChart.SeriesCollection[
0
].SetData (OWC11.ChartDimensionsEnum.chDimSeriesNames,
(
int
)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strSeriesName);
//
给定分类
objChart.SeriesCollection[
0
].SetData (OWC11.ChartDimensionsEnum.chDimCategories,
(
int
)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strCategory);
//
给定值
objChart.SeriesCollection[
0
].SetData
(OWC11.ChartDimensionsEnum.chDimValues,
(
int
)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue);
OWC11.ChDataLabels dls
=
objChart.SeriesCollection[
0
].DataLabelsCollection.Add();
dls.HasValue
=
true
;
dls.HasPercentage
=
true
;
dls.Font .Name
=
"
宋体
"
;
//
输出成GIF文件.
string
strAbsolutePath
=
(Server.MapPath(
"
.
"
))
+
"
\\test.gif
"
;
objCSpace.ExportPicture(strAbsolutePath,
"
GIF
"
,
600
,
450
);
//
创建GIF文件的相对路径.
string
strRelativePath
=
"
./test.gif
"
;
//
把图片添加到placeholder.
string
strImageTag
=
"
<IMG SRC='
"
+
strRelativePath
+
"
'/>
"
;
ChartHolder.Controls.Add(
new
LiteralControl(strImageTag));
}
Web 窗体设计器生成的代码
#region
Web 窗体设计器生成的代码
override
protected
void
OnInit(EventArgs e)
{
//
//
CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base
.OnInit(e);
}
/**/
///
<summary>
///
设计器支持所需的方法 - 不要使用代码编辑器修改
///
此方法的内容。
///
</summary>
private
void
InitializeComponent()
{
this
.Load
+=
new
System.EventHandler(
this
.Page_Load);
}
#endregion
}
}
查看全文
相关阅读:
iOS 苹果开发证书失效的解决方案(Failed to locate or generate matching signing assets)
iOS NSArray数组过滤
App Store2016年最新审核规则
iOS 根据字符串数目,自定义Label等控件的高度
iOS 证书Bug The identity used to sign the executable is no longer valid 解决方案
Entity FrameWork 增删查改的本质
EF容器---代理类对象
Entity FrameWork 延迟加载本质(二)
Entity FrameWork 延迟加载的本质(一)
Entity FrameWork 增删查改
原文地址:https://www.cnblogs.com/gwazy/p/262836.html
最新文章
实战入侵(突破FCK+安全狗上传)
Hydra用户手册
HFS远程命令执行漏洞入侵抓鸡黑阔服务器
HTTP参数污染
内网安全工具之cain劫持工具
剪切板
计算机编码方式
linux下安装pip以及导入第三方包
缓冲区(buffer)与缓存(cache)
有线网络接入技术
热门文章
计算机网络的性能指标
vim的基本介绍
Python3中无法导入ssl模块的解决办法
源程序与目标程序
计算机中的硬件与软件
UIPickerView的使用(一)
解决定时器在主线程不工作的问题
iOS AutoLayout的用法
iOS AppStore 申请加急审核
iOS 开发学习资料整理(持续更新)
Copyright © 2011-2022 走看看