在開發系統的時候有許多數據分析需要用圖形的方式來表現出,這樣更直觀又清淅。如果我們使用高級去動態
生成統計圖表的話不但編寫起來非常困難,而且實用性不是很好,從美觀的角度上講也是很設計的。然而Microsoft公司提供了一個專們的矢量畫圖語言,這就是VML.
如果要用VML去畫靜態頁面的話那是比較好看也好操作,但實用性不是很高。但要是畫出來的圖所表示的數據
是從數據庫里面讀取下來的可以動態表示要統計的內容的話,那實用性就不言而喻了。
最近我們也要做一個數據統計圖表,我想如果能把VML畫圖做成一個控件那該多很,做自定義控件(本人才疏學淺)我不怎么會做,但我們公司有個.NET很牛 的人,我經常看到他重寫.net里自帶的控件使這些控件變得更好用,于是我也產生一種想法,看能不能把VML也嵌套進去.結果做的還是有點起色.下面跟大 家分享一下.
生成統計圖表的話不但編寫起來非常困難,而且實用性不是很好,從美觀的角度上講也是很設計的。然而Microsoft公司提供了一個專們的矢量畫圖語言,這就是VML.
如果要用VML去畫靜態頁面的話那是比較好看也好操作,但實用性不是很高。但要是畫出來的圖所表示的數據
是從數據庫里面讀取下來的可以動態表示要統計的內容的話,那實用性就不言而喻了。
最近我們也要做一個數據統計圖表,我想如果能把VML畫圖做成一個控件那該多很,做自定義控件(本人才疏學淺)我不怎么會做,但我們公司有個.NET很牛 的人,我經常看到他重寫.net里自帶的控件使這些控件變得更好用,于是我也產生一種想法,看能不能把VML也嵌套進去.結果做的還是有點起色.下面跟大 家分享一下.
我是把VML圖表用Lable控件顯示出來的,給Lable類添加了一些自定義屬性.(在下面的代碼里面有的屬性還沒有用到用與以后擴展)
頁面代碼如下
<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
<%
@PageLanguage
=
"
C#
"
AutoEventWireup
=
"
true
"
CodeFile
=
"
DrawTest.aspx.cs
"
Inherits
=
"
DrawTest
"
%>
< html xmlns:v ="urn:schemas-microsoft-com:vml" xmlns:o ="urn:schemas-microsoft-com:office:office"
xmlns ="http://www.w3.org/1999/xhtml" >
< head id ="Head1" runat ="server" >
< title > Page </ title >
< style type ="text/css" >
v\:* { behavior : url(#default#VML) }
o\:* { behavior : url(#default#VML) }
.changeBg { FILTER : progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#FFFFFF,endColorStr=#9DCDFA) ;
}
.shadwDiv { width : 600px ; height : 500px ; text-align : center ; filter : progid:DXImageTransform.Microsoft.DropShadow(enabled=true,color=#000,offX=10,offY=10,positive=true) ; }
</ style >
</ head >
< body >
< form id ="form1" runat ="server" >
< div class ="shadwDiv" >
< div style ="padding-top:30px;border:solid2px#BBBBBB;background-color:#EFEFEF;
width:600px;height:500px;" >
< asp:VmlLabel ID ="labTest3" runat ="server" XWidth ="400" YHeight ="400" YPosition ="50"
IsDrawVML ="True" BgDistance ="10" EnableViewState ="False" ZhuWidth ="20" YItemWidth ="40"
CssClass ="changeBg" BorderColor ="White" BorderWidth ="0px" LineColor ="#4CAFFE"
XSign ="(年份)" YSign ="(萬/單位)" XPosition ="50" IsZhuOrBing ="Zhu" Redii ="80" ></ asp:VmlLabel >
</ div >
</ div >
</ form >
</ body >
</ html >
< html xmlns:v ="urn:schemas-microsoft-com:vml" xmlns:o ="urn:schemas-microsoft-com:office:office"
xmlns ="http://www.w3.org/1999/xhtml" >
< head id ="Head1" runat ="server" >
< title > Page </ title >
< style type ="text/css" >
v\:* { behavior : url(#default#VML) }
o\:* { behavior : url(#default#VML) }
.changeBg { FILTER : progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#FFFFFF,endColorStr=#9DCDFA) ;
}
.shadwDiv { width : 600px ; height : 500px ; text-align : center ; filter : progid:DXImageTransform.Microsoft.DropShadow(enabled=true,color=#000,offX=10,offY=10,positive=true) ; }
</ style >
</ head >
< body >
< form id ="form1" runat ="server" >
< div class ="shadwDiv" >
< div style ="padding-top:30px;border:solid2px#BBBBBB;background-color:#EFEFEF;
width:600px;height:500px;" >
< asp:VmlLabel ID ="labTest3" runat ="server" XWidth ="400" YHeight ="400" YPosition ="50"
IsDrawVML ="True" BgDistance ="10" EnableViewState ="False" ZhuWidth ="20" YItemWidth ="40"
CssClass ="changeBg" BorderColor ="White" BorderWidth ="0px" LineColor ="#4CAFFE"
XSign ="(年份)" YSign ="(萬/單位)" XPosition ="50" IsZhuOrBing ="Zhu" Redii ="80" ></ asp:VmlLabel >
</ div >
</ div >
</ form >
</ body >
</ html >
這里面的.<html>標簽里的” xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"
”和.
v\:*{ behavior: url(#default#VML) }
o\:*{ behavior: url(#default#VML) }
是必不可少的.
下面是CS代碼部分
<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
private
int
xposition;
private int yposition;
private int xwidth;
private int yheight;
private bool isdrawVML;
private int bgdistance; // 背景距離(斜線之間的垂直距離)
private int zhuWidth;
private string lineColor;
private int yItemWidth;
private string xSign; // X軸標記
private string ySign; // Y軸標記
private List < VmlDataSource > datasource;
private IszhuOrBingisZhuOrBing;
private int radii; // 畫餅圖要用的半徑
public IszhuOrBingIsZhuOrBing
{
get { return isZhuOrBing;}
set {isZhuOrBing = value;}
}
#region 屬性的定義
/// <summary>
/// 畫餅圖的半徑
/// </summary>
public int Redii
{
get { return radii;}
set {radii = value;}
}
/// <summary>
/// X軸的位置
/// </summary>
public int XPosition
{
get { return xposition;}
set {xposition = value;}
}
/// <summary>
/// Y軸位置
/// </summary>
public int YPosition
{
get { return yposition;}
set {yposition = value;}
}
//
/// <summary>
/// X軸寬度
/// </summary>
public int XWidth
{
get { return xwidth;}
set {xwidth = value;}
}
//
/// <summary>
/// Y軸高度
/// </summary>
public int YHeight
{
get { return yheight;}
set {yheight = value;}
}
/// <summary>
/// 是否是畫VML圖
/// </summary>
public bool IsDrawVML
{
get { return isdrawVML;}
set {isdrawVML = value;}
}
/// <summary>
/// 背景距離(斜線之間的垂直距離)
/// </summary>
public int BgDistance
{
get
{
return bgdistance;
}
set
{
if (value <= 0 )
bgdistance = 10 ;
else
bgdistance = value;
}
}
/// <summary>
/// 柱子的寬度
/// </summary>
public int ZhuWidth
{
get { return zhuWidth;}
set {zhuWidth = value;}
}
/// <summary>
/// 柱子的顏色
/// </summary>
public string LineColor
{
get { return lineColor;}
set {lineColor = value;}
}
/// <summary>
/// Y軸方向的間距
/// </summary>
public int YItemWidth
{
get { return yItemWidth;}
set {yItemWidth = value;}
}
/// <summary>
/// X軸標識
/// </summary>
public string XSign
{
get { return xSign;}
set {xSign = value;}
}
/// <summary>
/// Y軸標識
/// </summary>
public string YSign
{
get { return ySign;}
set {ySign = value;}
}
/// <summary>
/// 數據源(柱子高度)
/// </summary>
public List < VmlDataSource > DataSource
{
get { return datasource;}
set {datasource = value;}
}
#endregion
判斷是畫柱圖還是餅圖.
// 畫VML圖
StringBuildersbText = new StringBuilder();
string strHeight = "" ;
string strTop = "" ;
public void DrawVml()
{
if (isdrawVML == true )
{ //
if (isZhuOrBing == IszhuOrBing.Bing)
{
DrawBingImage();
}
else if (isZhuOrBing == IszhuOrBing.Zhu)
{
DrawZhuImage();
}
}
}
*** IsZhuOrBing是一個自定義的枚舉類型.
// 柱子一升的腳本
private string RegisterScript()
{
string m_strScript = " <scriptlanguage='javascript'type='text/javascript'> "
+ " vargao=0; "
+ " varProcID=0; "
+ " varProcName=null; "
+ " vari=0; "
+ " varHeightContent=document.getElementById('heightDataSource').value; "
+ " vararrHeight=newArray(); "
+ " vararrTop=newArray(); "
+ " arrHeight=HeightContent.split(','); "
+ " varshowBar=null; "
+ " functionAllPlay() "
+ " { "
+ " i++; "
+ " gao=0; "
+ " varprocBarID='DataZhu'+i; " // ;
+ " Play(procBarID); "
+ " } "
+ " functionPlay(procBarID) "
+ " { "
+ " varprocBar=document.getElementById(procBarID); "
+ " if(procBar!=null) "
+ " { "
+ " ProcName=procBar; "
+ " PlaySub(); "
+ " } "
+ " } "
+ " functionPlaySub() "
+ " { "
+ " varprocBar=ProcName; "
+ " showBar=document.getElementById('ShowData'+i); "
+ " showBar.style.display='block'; "
+ " gao++; "
+ " varygao=parseInt(procBar.style.height); "
+ " varytop=parseInt(procBar.style.top); "
+ " if(ygao<arrHeight[i-1]) "
+ " { "
+ " procBar.style.top=ytop-gao; "
+ " procBar.style.height=ygao+gao; "
+ " showBar.style.top=ytop-gao-25; "
+ " setTimeout(PlaySub,20); "
+ " } "
+ " else "
+ " { "
+ " AllPlay(); "
+ " } "
+ " } "
+ " </script> " ;
return m_strScript;
}
上面的那段代碼是要向客戶端注冊的JS腳本用于,畫柱圖時漸長效果的.
開始畫VML圖
// 畫柱圖.
public void DrawZhuImage()
{
base .Text = "" ;
// 畫Div
// sbText.Append("<divstyle='border:solid1pxred;width:"+(xwidth+10)+";height:"+(yheight+10)+";;filter:progid:DXImageTransform.Microsoft.DropShadow(enabled=true,color=#66333333,offX=4,offY=4,positive=true);'>");
sbText.Append( " <divid='PicDiv'style='left:0;position:relative;top:0;width: " + xwidth + " ;height: " + yheight + " ;text-align:left;'> " );
// base.Style.Value="left:"+xposition+";position:relative;top:"+yposition+";width:"+(xwidth+20)+";height:"+(20+yheight)+";'";
// 畫X軸
sbText.Append( " <v:lineid='Xzhou'from='0, " + yheight + " 'to=' " + xwidth + " , " + yheight + " '> "
+ " <v:strokeEndArrow='Classic'/></v:line><v:TextBoxstyle='position:absolute;width:100px;top: " + (yheight + 10 ) + " ;left: " + (xwidth) + " '> " + xSign + " </v:TextBox> " );
// 畫X軸方向的線條
int HaveData = ComputeX(xwidth);
// if(HaveData==0)
// {
// sbText.Append("</div>");
// base.Text=sbText.ToString(0,sbText.Length);
// return;
// }
// 畫Y軸
sbText.Append( " <v:lineid='Yzhou'from='0, " + yheight + " 'to='0,0'><v:strokeEndArrow='Classic'/><v:TextBoxstyle='width:100px;padding-left:10px;'> " + ySign + " </v:TextBox></v:line> " );
// 畫Y軸方向的線條
ComputeY(yheight);
// 畫DIV結束標記
sbText.Append( " </div> " );
// 畫隱形文本框
sbText.Append( " <inputtype='hidden'value=' " + strHeight.Substring( 0 ,strHeight.Length - 1 ) + " 'name='heightDataSource'id='heightDataSource'/> " );
sbText.Append( " <inputtype='hidden'value=' " + strTop.Substring( 0 ,strTop.Length - 1 ) + " 'name='topDataSource'id='topDataSource'/> " );
// 給Lable控件的Text賦值
base .Text = sbText.ToString( 0 ,sbText.Length);
Page.RegisterStartupScript( " zhuup " ,RegisterScript());
}
//
private int ComputeX( int XWidth)
{ // 柱子顏色數組
string [,]ZColor = new string [ 6 , 2 ];
ZColor[ 0 , 0 ] = " #666699 " ;ZColor[ 0 , 1 ] = " #d9d9e5 " ;
ZColor[ 1 , 0 ] = " #00ff00 " ;ZColor[ 1 , 1 ] = " #d1ffd1 " ;
ZColor[ 2 , 0 ] = " #ff0000 " ;ZColor[ 2 , 1 ] = " #ffbbbb " ;
ZColor[ 3 , 0 ] = " #ff9900 " ;ZColor[ 3 , 1 ] = " #ffe3bb " ;
ZColor[ 4 , 0 ] = " #33cccc " ;ZColor[ 4 , 1 ] = " #cff4f3 " ;
ZColor[ 5 , 0 ] = " #993300 " ;ZColor[ 5 , 1 ] = " #ffc7ab " ;
XWidth -= 10 ; // 箭頭下面的長度
int ColorIndex = 0 ;
double height = 0 ;
int Zhuposition = 0 ;
int Count = this .DataSource == null ? XWidth: this .DataSource.Count;
int num = 1 ;
// Count=0;
// if(Count==0)
// {
// sbText.Append("<divstyle='font-size:14px;color:red;'>暫無數據</div>");
// return0;
// }
int UnitLength = XWidth / Count; // 計算單位長度
foreach (VmlDataSourcevar in this .datasource)
{
// 畫X軸下標
sbText.Append( " <v:linefrom=' " + num * UnitLength + " , " + yheight + " 'to=' " + num * UnitLength + " , " + (yheight + bgdistance) + " '> "
+ " </v:line><v:shapestyle='left: " + (num * UnitLength - 50 ) + " ;top: " + yheight + " ;'><v:textbox> " + var.Key + " </v:textbox></v:shape> " );
height = var.value;
Zhuposition = ((num - 1 ) * UnitLength + UnitLength / 2 ) - (zhuWidth / 2 );
if (ColorIndex >= ZColor.Length / 2 )
{
ColorIndex = 0 ;
}
// sbText.Append("<v:rectid='DataZhu"+num+"'style='z-index:1;position:absolute;top:"+(yheight-height)+";"
sbText.Append( " <v:rectid='DataZhu " + num + " 'style='z-index:1;position:absolute;top: " + yheight + " ; "
+ " left: " + Zhuposition + " ;width: " + zhuWidth + " ;height:0;'fillcolor=' " + ZColor[ColorIndex, 0 ] + " '> "
+ " <v:fillcolor2=' " + ZColor[ColorIndex, 1 ] + " 'rotate='t'type='gradient'/> "
+ " <v:extrusionv:ext='view'backdepth=' " + ( 2 * bgdistance) + " 'color=' " + ZColor[ColorIndex, 0 ] + " 'brightness='0.2'on='t'/></v:rect> "
+ " <v:TextBoxid='ShowData " + num + " 'style='position:absolute;display:none;z-index:2;top: " + (yheight<
private int yposition;
private int xwidth;
private int yheight;
private bool isdrawVML;
private int bgdistance; // 背景距離(斜線之間的垂直距離)
private int zhuWidth;
private string lineColor;
private int yItemWidth;
private string xSign; // X軸標記
private string ySign; // Y軸標記
private List < VmlDataSource > datasource;
private IszhuOrBingisZhuOrBing;
private int radii; // 畫餅圖要用的半徑
public IszhuOrBingIsZhuOrBing
{
get { return isZhuOrBing;}
set {isZhuOrBing = value;}
}
#region 屬性的定義
/// <summary>
/// 畫餅圖的半徑
/// </summary>
public int Redii
{
get { return radii;}
set {radii = value;}
}
/// <summary>
/// X軸的位置
/// </summary>
public int XPosition
{
get { return xposition;}
set {xposition = value;}
}
/// <summary>
/// Y軸位置
/// </summary>
public int YPosition
{
get { return yposition;}
set {yposition = value;}
}
//
/// <summary>
/// X軸寬度
/// </summary>
public int XWidth
{
get { return xwidth;}
set {xwidth = value;}
}
//
/// <summary>
/// Y軸高度
/// </summary>
public int YHeight
{
get { return yheight;}
set {yheight = value;}
}
/// <summary>
/// 是否是畫VML圖
/// </summary>
public bool IsDrawVML
{
get { return isdrawVML;}
set {isdrawVML = value;}
}
/// <summary>
/// 背景距離(斜線之間的垂直距離)
/// </summary>
public int BgDistance
{
get
{
return bgdistance;
}
set
{
if (value <= 0 )
bgdistance = 10 ;
else
bgdistance = value;
}
}
/// <summary>
/// 柱子的寬度
/// </summary>
public int ZhuWidth
{
get { return zhuWidth;}
set {zhuWidth = value;}
}
/// <summary>
/// 柱子的顏色
/// </summary>
public string LineColor
{
get { return lineColor;}
set {lineColor = value;}
}
/// <summary>
/// Y軸方向的間距
/// </summary>
public int YItemWidth
{
get { return yItemWidth;}
set {yItemWidth = value;}
}
/// <summary>
/// X軸標識
/// </summary>
public string XSign
{
get { return xSign;}
set {xSign = value;}
}
/// <summary>
/// Y軸標識
/// </summary>
public string YSign
{
get { return ySign;}
set {ySign = value;}
}
/// <summary>
/// 數據源(柱子高度)
/// </summary>
public List < VmlDataSource > DataSource
{
get { return datasource;}
set {datasource = value;}
}
#endregion
判斷是畫柱圖還是餅圖.
// 畫VML圖
StringBuildersbText = new StringBuilder();
string strHeight = "" ;
string strTop = "" ;
public void DrawVml()
{
if (isdrawVML == true )
{ //
if (isZhuOrBing == IszhuOrBing.Bing)
{
DrawBingImage();
}
else if (isZhuOrBing == IszhuOrBing.Zhu)
{
DrawZhuImage();
}
}
}
*** IsZhuOrBing是一個自定義的枚舉類型.
// 柱子一升的腳本
private string RegisterScript()
{
string m_strScript = " <scriptlanguage='javascript'type='text/javascript'> "
+ " vargao=0; "
+ " varProcID=0; "
+ " varProcName=null; "
+ " vari=0; "
+ " varHeightContent=document.getElementById('heightDataSource').value; "
+ " vararrHeight=newArray(); "
+ " vararrTop=newArray(); "
+ " arrHeight=HeightContent.split(','); "
+ " varshowBar=null; "
+ " functionAllPlay() "
+ " { "
+ " i++; "
+ " gao=0; "
+ " varprocBarID='DataZhu'+i; " // ;
+ " Play(procBarID); "
+ " } "
+ " functionPlay(procBarID) "
+ " { "
+ " varprocBar=document.getElementById(procBarID); "
+ " if(procBar!=null) "
+ " { "
+ " ProcName=procBar; "
+ " PlaySub(); "
+ " } "
+ " } "
+ " functionPlaySub() "
+ " { "
+ " varprocBar=ProcName; "
+ " showBar=document.getElementById('ShowData'+i); "
+ " showBar.style.display='block'; "
+ " gao++; "
+ " varygao=parseInt(procBar.style.height); "
+ " varytop=parseInt(procBar.style.top); "
+ " if(ygao<arrHeight[i-1]) "
+ " { "
+ " procBar.style.top=ytop-gao; "
+ " procBar.style.height=ygao+gao; "
+ " showBar.style.top=ytop-gao-25; "
+ " setTimeout(PlaySub,20); "
+ " } "
+ " else "
+ " { "
+ " AllPlay(); "
+ " } "
+ " } "
+ " </script> " ;
return m_strScript;
}
上面的那段代碼是要向客戶端注冊的JS腳本用于,畫柱圖時漸長效果的.
開始畫VML圖
// 畫柱圖.
public void DrawZhuImage()
{
base .Text = "" ;
// 畫Div
// sbText.Append("<divstyle='border:solid1pxred;width:"+(xwidth+10)+";height:"+(yheight+10)+";;filter:progid:DXImageTransform.Microsoft.DropShadow(enabled=true,color=#66333333,offX=4,offY=4,positive=true);'>");
sbText.Append( " <divid='PicDiv'style='left:0;position:relative;top:0;width: " + xwidth + " ;height: " + yheight + " ;text-align:left;'> " );
// base.Style.Value="left:"+xposition+";position:relative;top:"+yposition+";width:"+(xwidth+20)+";height:"+(20+yheight)+";'";
// 畫X軸
sbText.Append( " <v:lineid='Xzhou'from='0, " + yheight + " 'to=' " + xwidth + " , " + yheight + " '> "
+ " <v:strokeEndArrow='Classic'/></v:line><v:TextBoxstyle='position:absolute;width:100px;top: " + (yheight + 10 ) + " ;left: " + (xwidth) + " '> " + xSign + " </v:TextBox> " );
// 畫X軸方向的線條
int HaveData = ComputeX(xwidth);
// if(HaveData==0)
// {
// sbText.Append("</div>");
// base.Text=sbText.ToString(0,sbText.Length);
// return;
// }
// 畫Y軸
sbText.Append( " <v:lineid='Yzhou'from='0, " + yheight + " 'to='0,0'><v:strokeEndArrow='Classic'/><v:TextBoxstyle='width:100px;padding-left:10px;'> " + ySign + " </v:TextBox></v:line> " );
// 畫Y軸方向的線條
ComputeY(yheight);
// 畫DIV結束標記
sbText.Append( " </div> " );
// 畫隱形文本框
sbText.Append( " <inputtype='hidden'value=' " + strHeight.Substring( 0 ,strHeight.Length - 1 ) + " 'name='heightDataSource'id='heightDataSource'/> " );
sbText.Append( " <inputtype='hidden'value=' " + strTop.Substring( 0 ,strTop.Length - 1 ) + " 'name='topDataSource'id='topDataSource'/> " );
// 給Lable控件的Text賦值
base .Text = sbText.ToString( 0 ,sbText.Length);
Page.RegisterStartupScript( " zhuup " ,RegisterScript());
}
//
private int ComputeX( int XWidth)
{ // 柱子顏色數組
string [,]ZColor = new string [ 6 , 2 ];
ZColor[ 0 , 0 ] = " #666699 " ;ZColor[ 0 , 1 ] = " #d9d9e5 " ;
ZColor[ 1 , 0 ] = " #00ff00 " ;ZColor[ 1 , 1 ] = " #d1ffd1 " ;
ZColor[ 2 , 0 ] = " #ff0000 " ;ZColor[ 2 , 1 ] = " #ffbbbb " ;
ZColor[ 3 , 0 ] = " #ff9900 " ;ZColor[ 3 , 1 ] = " #ffe3bb " ;
ZColor[ 4 , 0 ] = " #33cccc " ;ZColor[ 4 , 1 ] = " #cff4f3 " ;
ZColor[ 5 , 0 ] = " #993300 " ;ZColor[ 5 , 1 ] = " #ffc7ab " ;
XWidth -= 10 ; // 箭頭下面的長度
int ColorIndex = 0 ;
double height = 0 ;
int Zhuposition = 0 ;
int Count = this .DataSource == null ? XWidth: this .DataSource.Count;
int num = 1 ;
// Count=0;
// if(Count==0)
// {
// sbText.Append("<divstyle='font-size:14px;color:red;'>暫無數據</div>");
// return0;
// }
int UnitLength = XWidth / Count; // 計算單位長度
foreach (VmlDataSourcevar in this .datasource)
{
// 畫X軸下標
sbText.Append( " <v:linefrom=' " + num * UnitLength + " , " + yheight + " 'to=' " + num * UnitLength + " , " + (yheight + bgdistance) + " '> "
+ " </v:line><v:shapestyle='left: " + (num * UnitLength - 50 ) + " ;top: " + yheight + " ;'><v:textbox> " + var.Key + " </v:textbox></v:shape> " );
height = var.value;
Zhuposition = ((num - 1 ) * UnitLength + UnitLength / 2 ) - (zhuWidth / 2 );
if (ColorIndex >= ZColor.Length / 2 )
{
ColorIndex = 0 ;
}
// sbText.Append("<v:rectid='DataZhu"+num+"'style='z-index:1;position:absolute;top:"+(yheight-height)+";"
sbText.Append( " <v:rectid='DataZhu " + num + " 'style='z-index:1;position:absolute;top: " + yheight + " ; "
+ " left: " + Zhuposition + " ;width: " + zhuWidth + " ;height:0;'fillcolor=' " + ZColor[ColorIndex, 0 ] + " '> "
+ " <v:fillcolor2=' " + ZColor[ColorIndex, 1 ] + " 'rotate='t'type='gradient'/> "
+ " <v:extrusionv:ext='view'backdepth=' " + ( 2 * bgdistance) + " 'color=' " + ZColor[ColorIndex, 0 ] + " 'brightness='0.2'on='t'/></v:rect> "
+ " <v:TextBoxid='ShowData " + num + " 'style='position:absolute;display:none;z-index:2;top: " + (yheight<
發表評論
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元

評論