gengwei80的专栏

欣然自在来,了无牵挂去。管它潇洒不潇洒,风自萧萧我自傻!

asp.net+vml实现饼图制作


<%@ Import Namespace="System.Web " %>
<%@ Import Namespace="System.Web.Security " %>
<%@ Import Namespace="System.Data " %>
<%@ Import Namespace="System.Data.SqlClient " %>
<%@ Import Namespace="System.Data.OleDb " %>
" + pie.title + "";
}
function hide(pie){
pie.strokecolor="white";
pie.strokeweight=1;
//div1.innerHTML="";
}
function msg(pie){
// alert(pie.title);
}

???????? float total=0.0f,tmp;
???????? int iloop;
???????? for(iloop=0;iloop??????? {
?????????????? tmp=Convert.ToInt32(ds.Tables[0].Rows[iloop][1]);
?????????????? total+=tmp;
??????? }
??float PreAngle=0.0f;
??//Response.Write(ds.Tables[0].Rows.Count);
??for(iloop=0;iloop??{
?????????????? tt.InnerHtml += "";

??PreAngle += Convert.ToSingle(ds.Tables[0].Rows[iloop][1])/total;
??// Response.Write(PreAngle);
??}

??????????????? Double pie=3.14159265358979;
??Double x3,x4;
??????????????? float TempPie=0.0f;
??????????????? for(iloop=0;iloop??{
?????????????????? Double TempAngle=pie*2*(Convert.ToSingle(ds.Tables[0].Rows[iloop][1])/(total*2)+TempPie);
??//?? Response.Write(TempAngle+"
");
?????????????????? Double x1=table_x+all_width/2+Math.Cos(TempAngle)*all_width*3/8;
?????????????????? Double y1=table_y+all_height/2-Math.Sin(TempAngle)*all_height*3/8;
?????????????????? Double x2=table_x+all_width/2+Math.Cos(TempAngle)*all_width*3/4;
?????????????????? Double y2=table_y+all_height/2-Math.Sin(TempAngle)*all_height*3/4;
?????????????????? if(x2>table_x+all_width/2)
???? {
?????????????????????????? x3=x2;
?????????????????????????? x4=x3;
???? }
?????????????????? else{
?????????????????????????? x3=x2-20;
?????????????????????????? x4=x3-60;
???? }
??????????????? //?? Response.Write("x1="+x1+",y1="+y1+",x2="+x2+",y2="+y2+",x3="+x3+",x4="+x4+"
");
???? ss.InnerHtml += "";
???? ss.InnerHtml += "";
???? ss.InnerHtml += "

"+(Convert.ToSingle(ds.Tables[0].Rows[iloop][1])/total)*100+"% "+ds.Tables[0].Rows[iloop][0]+"
";
???? TempPie=TempPie+Convert.ToSingle(ds.Tables[0].Rows[iloop][1])/total;
???????????????? }
??//显示标住信息
??//ss.InnerHtml = "";
??//for(iloop=0;iloop??{
??// ss.InnerHtml += "";
??????????????? // ss.InnerHtml += "
"+ds.Tables[0].Rows[iloop][0]+"
";

??????????????? // ss.InnerHtml += "";

???????????????? //显示比例数
??????????????? // ss.InnerHtml += "";

??????????????? // ss.InnerHtml += "

"+ds.Tables[0].Rows[iloop][1]+"
";
??}
? }



调用:












<%@ Import Namespace="System " %>
<%@ Import Namespace="System.Web " %>
<%@ Import Namespace="System.Web.Security " %>
<%@ Import Namespace="System.Data " %>
<%@ Import Namespace="System.Data.SqlClient " %>
<%@ Import Namespace="System.Data.OleDb " %>
<%@ Register TagPrefix="WebReport" TagName="Chart" Src="../source/webreport.ascx"%>



<?XML:NAMESPACE PREFIX = WebReport />


阅读更多
个人分类: .NET
想对作者说点什么? 我来说一句

js实现动态饼图

2013年11月14日 11KB 下载

js chart 绘制柱形图 饼图等

2010年06月28日 203KB 下载

LABVIEW 饼图

2013年07月23日 14KB 下载

没有更多推荐了,返回首页

不良信息举报

asp.net+vml实现饼图制作

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭