C#三维饼图

C# 3D 饼图 PieChart 三维 C# 3D 饼图 PieChart 三维 资料整理,一起分享! 立即下载

<% @ Page Language="C#" %>  <% @ Page Language="C#" %>
<script language="C#" runat="server">
public void table2(string[,] stat_array,int table_left,int table_top,int all_width,int all_height,string table_title,string unit)
{
string[] bg_color=new string[10];
double[] pie=new double[11];
bg_color[0]="#ff1919";
bg_color[1]="#ffff19";
bg_color[2]="#1919ff";
bg_color[3]="#19ff19";
bg_color[4]="#fc0";
bg_color[5]="#3cc";
bg_color[6]="#ff19ff";
bg_color[7]="#993300";
bg_color[8]="#f60";
bg_color[9]="#ff8c19";

int num =stat_array.GetLength(0);
int allvalues=0;
for(int i=0;i<num;i++)
{
allvalues = allvalues+int.Parse(stat_array[i,0]);
}
double k=0;
for(int i=0;i<num;i++)
{
pie[i]=double.Parse(String.Format("{0:F4}",(int.Parse(stat_array[i,0])/(allvalues+0.0))));
}
//pie[9]=double.Parse(String.Format("{0:F4}",(int.Parse(stat_array[9,0])/(allvalues+0.0))));
for(int i=0;i<num-1;i++)
{
k=k+pie[i];
}
pie[num]=(1-k);

///////////////////////////////////////
Response.Write( "<v:shapetype id='Cake_3D' coordsize='21600,21600' o:spt='95' adj='11796480,5400' path='al10800,10800@0@0@2@14,10800,10800,10800,10800@3@15xe'></v:shapetype>");

Response.Write( "<v:shapetype id='3dtxt' coordsize='21600,21600' o:spt='136' adj='10800' path='m@7,l@8,m@5,21600l@6,21600e'> ");
Response.Write( " <v:path textpathok='t' o:connecttype='custom' o:connectlocs='@9,0;@10,10800;@11,21600;@12,10800' o:connectangles='270,180,90,0'/>");
Response.Write( " <v:textpath on='t' fitshape='t'/>");
Response.Write( " <o:lock v:ext='edit' text='t' shapetype='t'/>");
Response.Write( "</v:shapetype>");

Response.Write( "<v:rect id='background' style='position:absolute;left:"+table_left+"px;top:"+table_top+"px;WIDTH:"+all_width+"px;HEIGHT:"+all_height+"px;' fillcolor='#EFEFEF' strokecolor='gray'>");
Response.Write( " <v:shadow on='t' type='single' color='silver' offset='4pt,4pt'/>");
Response.Write( "</v:rect>");

Response.Write( "<v:group ID='table' style='position:absolute;left:"+table_left+"px;top:"+table_top+"px;WIDTH:"+all_width+"px;HEIGHT:"+all_height+"px;' coordsize = '21000,11500'>");
Response.Write( " <v:Rect style='position:relative;left:500;top:200;width:20000;height:800'filled='false' stroked='false'>");
Response.Write( " <v:TextBox inset='0pt,0pt,0pt,0pt'>");
Response.Write( " <table width='100%' border='0' align='center' cellspacing='0'>");
Response.Write( " <tr>");
Response.Write( " <td align='center' valign='middle'><div style='font-size:15pt; font-family:黑体;'><B>"+table_title+"</B></div></td>");
Response.Write( " </tr>");
Response.Write( " </table>");
Response.Write( " </v:TextBox>");
Response.Write( " </v:Rect> ");

Response.Write( " <v:rect id='back' style='position:relative;left:500;top:1000;width:20000; height:10000;' onmouseover='movereset(1)' onmouseout='movereset(0)' fillcolor='#9cf' strokecolor='#888888'>");
Response.Write( " <v:fill rotate='t' angle='-45' focus='100%' type='gradient'/>");
Response.Write( " </v:rect>");

Response.Write( " <v:rect id='back' style='position:relative;left:15000;top:1400;width:5000; height:"+((num+1)*9000/11+200)+";' fillcolor='#9cf' stroked='t' strokecolor='#0099ff'>");
Response.Write( " <v:fill rotate='t' angle='-175' focus='100%' type='gradient'/>");
Response.Write( " <v:shadow on='t' type='single' color='silver' offset='3pt,3pt'/>");
Response.Write( " </v:rect>");

Response.Write( " <v:Rect style='position:relative;left:15500;top:1500;width:4000;height:700' fillcolor='#000000' stroked='f' strokecolor='#000000'>");
Response.Write( " <v:TextBox inset='8pt,4pt,3pt,3pt' style='font-size:11pt;'><div align='left'><font color='#ffffff'><B>总数:"+allvalues+unit+"</B></font></div></v:TextBox>");
Response.Write( " </v:Rect> ");
for(int i=1;i<=num;i++)
{
Response.Write( " <v:Rect id='rec"+i+"' style='position:relative;left:15400;top:"+(i*9000.0/11.0+1450)+";width:4300;height:800;display:none' fillcolor='#efefef' strokecolor='"+bg_color[i-1]+"'>");
Response.Write( " <v:fill opacity='.6' color2='fill darken(118)' o:opacity2='.6' rotate='t' method='linear sigma' focus='100%' type='gradient'/>");
Response.Write( " </v:Rect>");
Response.Write( " <v:Rect style='position:relative;left:15500;top:"+(i*9000/11.0+1500)+";width:600;height:700' fillcolor='"+bg_color[i-1]+"' stroked='f'/>");
Response.Write( " <v:Rect style='position:relative;left:16300;top:"+(i*9000/11.0+1500)+";width:3400;height:700' filled='f' stroked='f'>");
Response.Write( " <v:TextBox inset='0pt,5pt,0pt,0pt' style='font-size:9pt;'><div align='left'>"+stat_array[i-1,1]+":"+stat_array[i-1,0]+unit+"</div></v:TextBox>");
Response.Write( " </v:Rect> ");
}

Response.Write( "</v:group>");;
////////////////////////////////////////
double k1=180;
double k4=10;
double k3=0;
double k2=0;
double k5=0;
for(int i=1;i<=num;i++){
k2=360*pie[i-1]/2;
k3=k1+k2;
if (k3>=360)
k3=k3-360;
double kkk=(-11796480*pie[i-1]+5898240);

k5=3.1414926*2*(180-(k3-180))/360;
int R=all_height/2;
double txt_x = table_left+all_height/8-30+R+R*Math.Sin(k5)*0.7;
double txt_y = table_top+all_height/14-39+R+R*Math.Cos(k5)*0.7*0.5;
////////////////////////////////////////
string titlestr = "&nbsp;名&nbsp;&nbsp;称:"+stat_array[i-1,1]+"&#13;&#10;&nbsp;数&nbsp;&nbsp;值:"+stat_array[i-1,0]+unit+"&#13;&#10;&nbsp;所占比例:"+pie[i-1]*100+"%&nbsp;&nbsp;";
//Response.Write(pie[i-1]);
Response.Write( " <div style='cursor:hand;'>");
Response.Write( " <v:shape id='cake"+i+"' type='#Cake_3D' title='"+titlestr+"'");
Response.Write( " style='position:absolute;left:"+(table_left+all_height/8)+"px;top:"+(table_top+all_height/14)+"px;WIDTH:"+all_height+"px;HEIGHT:"+all_height+"px;rotation:"+k3+";z-index:"+k4+"'");
Response.Write( " adj='"+kkk+",0' fillcolor='"+bg_color[i-1]+"' onmouseover='moveup(cake"+i+","+(table_top+all_height/14)+",txt"+i+",rec"+i+")'; onmouseout='movedown(cake"+i+","+(table_top+all_height/14)+",txt"+i+",rec"+i+");'>");
Response.Write( " <v:fill opacity='60293f' color2='fill lighten(120)' o:opacity2='60293f' rotate='t' angle='-135' method='linear sigma' focus='100%' type='gradient'/>");
Response.Write( " <o:extrusion v:ext='view' on='t'backdepth='25' rotationangle='60' viewpoint='0,0'viewpointorigin='0,0' skewamt='0' lightposition='-50000,-50000' lightposition2='50000'/>");
Response.Write( " </v:shape>");
Response.Write( " <v:shape id='txt"+i+"' type='#3dtxt' style='position:absolute;left:"+txt_x+"px;top:"+txt_y+"px;z-index:20;display:none;width:50; height:18;' fillcolor='#ffffff'");
Response.Write( " onmouseover='ontxt(cake"+i+","+(table_top+all_height/14)+",txt"+i+",rec"+i+")'>");
Response.Write( " <v:fill opacity='60293f' color2='fill lighten(120)' o:opacity2='60293f' rotate='t' angle='-135' method='linear sigma' focus='100%' type='gradient'/>");
Response.Write( " <v:textpath style='font-family:'宋体';v-text-kern:t' trim='t' fitpath='t' string='"+(pie[i-1]*100)+"%'/>");
Response.Write( " <o:extrusion v:ext='view' backdepth='8pt' on='t' lightposition='0,0' lightposition2='0,0'/>");
Response.Write( " </v:shape>");
Response.Write( " </div>");
k1=k1+k2*2;
if(k1>=360)k1=k1-360;
if(k1>180)k4=k4+1;
else k4=k4-1;
}
}

</script>


<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title></title>
<STYLE>
v/:* { Behavior: url(#default#VML) }
o/:* { behavior: url(#default#VML) }
</STYLE>
</head>
<body>

<SCRIPT LANGUAGE="JavaScript">
<!--
onit=true
num=0
function moveup(iteam,top,txt,rec){
temp=eval(iteam)
tempat=eval(top)
temptxt=eval(txt)
temprec=eval(rec)
at=parseInt(temp.style.top)
temprec.style.display = "";
if (num>27){
temptxt.style.display = "";
}
if(at>(tempat-28)&&onit){
num++
temp.style.top=at-1
Stop=setTimeout("moveup(temp,tempat,temptxt,temprec)",10)
}else{
return
}
}
function movedown(iteam,top,txt,rec){
temp=eval(iteam)
temptxt=eval(txt)
temprec=eval(rec)
clearTimeout(Stop)
temp.style.top=top
num=0
temptxt.style.display = "none";
temprec.style.display = "none";
}
function ontxt(iteam,top,txt,rec){
temp = eval(iteam);
temptxt = eval(txt);
temprec = eval(rec)
if (onit){
temp.style.top = top-28;
temptxt.style.display = "";
temprec.style.display = "";
}
}
function movereset(over){
if (over==1){
onit=false
}else{
onit=true
}
}
-->
</script>
<%
string[,] total=new string[10,2];

total[0,0]="2000";
total[1,0]="1800";
total[2,0]="1700";
total[3,0]="1500";
total[4,0]="1222";
total[5,0]="1100";
total[6,0]="1000";
total[7,0]="800";
total[8,0]="700";
total[9,0]="600";

total[0,1]="项目1";
total[1,1]="项目2";
total[2,1]="项目3";
total[3,1]="项目4";
total[4,1]="项目5";
total[5,1]="项目6";
total[6,1]="项目7";
total[7,1]="项目8";
total[8,1]="项目9";
total[9,1]="项目10";

table2(total,240,200,700,400,"三维饼状图","元");
%>
</body>
</html>
<% string[,] total=new string[10,2]; total[0,0]="2000"; total[1,0]="1800"; total[2,0]="1700"; total[3,0]="1500"; total[4,0]="1222"; total[5,0]="1100"; total[6,0]="1000"; total[7,0]="800"; total[8,0]="700"; total[9,0]="600"; total[0,1]="项目1"; total[1,1]="项目2"; total[2,1]="项目3"; total[3,1]="项目4"; total[4,1]="项目5"; total[5,1]="项目6"; total[6,1]="项目7"; total[7,1]="项目8"; total[8,1]="项目9"; total[9,1]="项目10"; table2(total,240,200,700,400,"三维饼状图","元"); %><% @ Page Language="C#" %> <% @ Page Language="C#" %> <% @ Page Language="C#" %> <% @ Page Language="C#" %> <% string[,] total=new string[10,2]; total[0,0]="2000"; total[1,0]="1800"; total[2,0]="1700"; total[3,0]="1500"; total[4,0]="1222"; total[5,0]="1100"; total[6,0]="1000"; total[7,0]="800"; total[8,0]="700"; total[9,0]="600"; total[0,1]="项目1"; total[1,1]="项目2"; total[2,1]="项目3"; total[3,1]="项目4"; total[4,1]="项目5"; total[5,1]="项目6"; total[6,1]="项目7"; total[7,1]="项目8"; total[8,1]="项目9"; total[9,1]="项目10"; table2(total,240,200,700,400,"三维饼状图","元"); %> <% string[,] total=new string[10,2]; total[0,0]="2000"; total[1,0]="1800"; total[2,0]="1700"; total[3,0]="1500"; total[4,0]="1222"; total[5,0]="1100"; total[6,0]="1000"; total[7,0]="800"; total[8,0]="700"; total[9,0]="600"; total[0,1]="项目1"; total[1,1]="项目2"; total[2,1]="项目3"; total[3,1]="项目4"; total[4,1]="项目5"; total[5,1]="项目6"; total[6,1]="项目7"; total[7,1]="项目8"; total[8,1]="项目9"; total[9,1]="项目10"; table2(total,240,200,700,400,"三维饼状图","元"); %> <% string[,] total=new string[10,2]; total[0,0]="2000"; total[1,0]="1800"; total[2,0]="1700"; total[3,0]="1500"; total[4,0]="1222"; total[5,0]="1100"; total[6,0]="1000"; total[7,0]="800"; total[8,0]="700"; total[9,0]="600"; total[0,1]="项目1"; total[1,1]="项目2"; total[2,1]="项目3"; total[3,1]="项目4"; total[4,1]="项目5"; total[5,1]="项目6"; total[6,1]="项目7"; total[7,1]="项目8"; total[8,1]="项目9"; total[9,1]="项目10"; table2(total,240,200,700,400,"三维饼状图","元"); %> <% string[,] total=new string[10,2]; total[0,0]="2000"; total[1,0]="1800"; total[2,0]="1700"; total[3,0]="1500"; total[4,0]="1222"; total[5,0]="1100"; total[6,0]="1000"; total[7,0]="800"; total[8,0]="700"; total[9,0]="600"; total[0,1]="项目1"; total[1,1]="项目2"; total[2,1]="项目3"; total[3,1]="项目4"; total[4,1]="项目5"; total[5,1]="项目6"; total[6,1]="项目7"; total[7,1]="项目8"; total[8,1]="项目9"; total[9,1]="项目10"; table2(total,240,200,700,400,"三维饼状图","元"); %>

C#开发的3D图表控件,适用于winform项目,使用了opentk绘制3D图形。图表颜色,文字颜色,均可以替换 C#开发的3D图表控件,适用于winform项目,使用了opentk绘制3D图形,代码原创。 图表颜色,文字颜色,均可以替换。 支持鼠标拖拽旋转。 立即下载

相关推荐

C#winform使用的3D图表控件源代码,使用了SharpGL

C#winform使用的3D图表控件源代码,使用了SharpGL opentk文字显示效果不理想,因此这个是使用了SharpGL绘制的, 文字绘制是采用了文字缓存为图形的方式绘制的,整体效果还不错 这个版本应该是可以直接使用

C# Winform 3DChart 开源控件

C# 关于3D图形控件的非常少,不像Matlab,Python一样可以渲染出非常漂亮的3D效果图,强大的Devexpress关于3D方法的也做得不是很好。C# 纯源码开发的3D图显示控件,已经打包成DLL,直接调用即可,拖放到窗体上使用,可以设置很多属性,1、设置ColorBar是否显示,Colorbar的渐变颜色,多种选项。3、观察视角可调整:不同角度查看(此功能独有!功能实在太多,不太可能一一介绍,有需要的可以私聊。4、调用代码简单,几行代码即可完成。下面show几张效果图。

业余程序员小徐的博客 1万+

C#3D计算机图形学开发项目完整代码

该项目是在《C#二三维图形绘制》一书的基础上二次创造而成,下载项目文件后里面包含.exe文件可直接运行,而且包含所有源代码,方便结合书本学习!

C#三维图表实现,不调用任何控件

C#三维图表实现,不调用任何控件 程序来自于【C#二维三维图形绘制工程实例宝典+[伍逸著][2010.12]】Example8_2_1

jemi_A的博客 3811

C#chart控件画3D柱状、折线图

在C#中用chart控件画折线图,特别适合新手学习

C#中绘制3D模型的方法——面面拉伸

绘制三维模型时,先根据点画出面,通过面与面之间的连接绘制出形体。 适用于一些不规则的形体绘制。

C#,SharpGL开发的3D图表控件

C#,SharpGL开发的3D图表控件

5227

3D Slicer的学习(二) 图像的分割

先对不同层级标注,然后点击Fill between slices -> Initialize -> Apply拖动层级颜色区域就会变成连续自适应的动态变化区域。如图,点击Level tracing,在图像上放置鼠标,会显示可能想要选中区域的轮廓,点击鼠标右键会将其显示为蓝色。然后点击Grow from seeds -> Initialize -> Apply,显示3D之后会自动扩展到其他位置的相同部位,从而展示整个部位。如图为copy之后,将黄色区域的颜色复制到原本的绿色区域。

tuweibazong的博客 6082

.net实现3D饼图(源码1)

点击此处下载源码+test代码(99KB,rar) 本来想改改几个bug再整理下发上来的。但是最近工作比较紧张,没有时间。发出来大家看看。多提提意见。帮忙改改。  using System; using System.Collections; using System.Drawing; using System.IO; using System.Drawing.Imaging;

KimmKing的技术博客 3956

关于使用vcpkg下载osgearth遇到的问题

注意--x-manifest-root=后面跟着的E:\gitproject\osgearth-osgearth-3.5\vcpkg是你下载的源码解压缩后vcpkg.json的文件地址,然后等待编译完成。安装vcpkg后使用vcpkg install osgearth:x64-windows安装好osgearth并且导入项目使用时,发现无法运行官方文档中示例的main.cpp。这里写一种自己用过的使用vcpkg安装osgearth3.5的方法,源码,打开vcpkg所在的命令行,执行。示例main.cpp。

m0_61776040的博客 1526

AutoSAR EcuM系列01- EcuM模块的功能概述和变体类型

在【ECU的软硬件架构】文章中我们了解ECU的功能和组成,那么ECU具体是怎么启动的呢?我们知道,AutoSAR标准架构有三层,即APPL应用层、RTE层和BSW层。而这些层又被进一步划分为更多单独的组件,如BSW层可能有80多个组件。在ECU启动时,这些组件必须相互交互,有时也必须以某种顺序交互。这些组件的启动顺序由ECU管理器模块或EcuM处理。EcuM负责整个ECU的初始化和去初始化,包括对一些系统模块如。......

1766

Matlab vs C#

Matlab vs C# 注意:空项目创建 C# project时,必须

jiangdmdr的专栏 597

【ArcGIS微课1000例】0066:图像融合(全色+多光谱)操作案例教程

图像融合是指将不同类型传感器的影像进行融合,既能使图向具有较高的空间分辨率,又具有多光谱的特性。除了遥感软件如Erdas能进行图像融合,ArcGIS软件也可以进行图像融合等图像增强操作。

智慧空间实验室 3077

c# chart控件基本使用方法(柱状图和饼图)

1 chartType.Series.Clear(); 2 chartType.ChartAreas.Clear(); 3 if (rbtnPie.Checked) 4 { 5 Series Series1 = new Series(); 6 ...

weixin_30596165的博客 502

[Python从零到壹] 十三.机器学习之聚类算法四万字总结全网首发(K-Means、BIRCH、树状聚类、MeanShift)

欢迎大家来到“Python从零到壹”,在这里我将分享约200篇Python系列文章,带大家一起去学习和玩耍,看看Python这个有趣的世界。所有文章都将结合案例、代码和作者的经验讲解,真心想把自己近十年的编程经验分享给大家,希望对您有所帮助,文章中不足之处也请海涵。Python系列整体框架包括基础语法10篇、网络爬虫30篇、可视化分析10篇、机器学习20篇、大数据分析20篇、图像识别30篇、人工智能40篇、Python安全20篇、其他技巧10篇。您的关注、点赞和转发就是对秀璋最大的支持,知识无价人有情,希望

杨秀璋的专栏 2万+

从苏宁电器到卡巴斯基第02篇:我的本科时光(中)

怎么还分班了呢? 大概是在大二第二学期的时候吧,学院突然通知我们要分班。因为我们目前所有学生都是属于工商管理专业的,而从下个学期开始,就要分为会计、市场营销以及工商管理这三个方向。这还真是打了我一个措手不及,我都不知道还有分班这一回事。不过也没关系,我继续选择我的工商管理就好了。不过,在实际的选择结果上,像会计和工商管理这种学科,选的人自然是占了绝大多数,而选择市场营销的,大概也就是十

Gleam的专栏 9607

微软Chart控件

1.Tutorial: VS2008 C# Pie Chart 2.3D Pie Chart 3.System.Windows.Forms.DataVisualization.Charting 命名空间 转载于:https://www.cnblogs.com/tough/archive/2011/11/14/2248651.html

weixin_33928137的博客 66

Agent Harness Engineering: AI Agent 执行管控与安全沙箱 原理与最佳实践

我们正站在计算范式转移的历史节点上。2024-2026 年间,AI 系统从被动的内容生成器(Generative AI)演变为主动的行动执行者(Agentic AI)。这一转变的根本特征是:根据 2026 年初的行业数据:然而,能力的提升伴随着风险的指数级增长。2024-2026 年间发生的多起标志性安全事件揭示了 Agent 系统的脆弱性:案例 1:Slack AI 数据外泄事件(2024 年 8 月)案例 2:制造业供应链攻击(2026 年 Q3)案例 3:Arup 深度诈骗案(2026 年 9 月)这

AI天才研究院 1669

DevXpress控件: 第二篇--将绘图进行到底: Charter控件(附图)

一. 2D 1. 散点图 [c-sharp]view plaincopyprint? 散点图--CreatedBy FQGUO this.xtraTabControl1.TabPages.Add("普通散点图"); ChartControl pointChart =newChartCo...

banyu4566的博客 333

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Dragonfly DASChart .Net 自控领域广泛应用的.NET图表控件

Dragonfly DASChart .Net 自控领域广泛应用的.NET图表控件 Dragonfly Chart .Net for Windows Form. 包括七个图表.Net控件, 属于下列类型, 饼图、环图、条形...

165

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

上一篇: 异常详细信息: System.UnauthorizedAccessException:
下一篇: DataBase
677
677
博客等级 码龄22年 5粉丝 15原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值