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
}
}
查看全文
相关阅读:
三维dem
geoserver 通过代码实现发布地图服务
restful发布服务
php防攻击
redis主从复制
redis虚拟内存
redis 持久化
lamp源码安装
mysql优化
php匿名函数与闭包函数
原文地址:https://www.cnblogs.com/gwazy/p/262836.html
最新文章
奶牛分厩
奶酪
统计和
ubuntu配置静态路由
SQLyog使用,连接ubuntu虚拟机(Error No.2003)
linux 进程间通信机制(IPC机制)- 管道
gdb调试程序
linux 进程间通信机制(IPC机制)一消息队列
linux 进程间通信机制(IPC机制)一总览
linux ubuntu常用命令
热门文章
c语言常使用的函数,见到一个记一个
c 数组作为返回值注意
c语言 参数传值和传地址
挪过来的spring mvc 的入门 介绍
@RequestMapping 介绍
一些概念
eclipse
mvn 使用
linux 操作笔记
geoserver中除了使用kml来查询数据以外,还可以使用csql或ecsql
Copyright © 2011-2022 走看看