Source document, pie chart data
Copy Code code as follows:
<?xml version= "1.0" encoding= "Utf-8"?>
<items>
<title> proportion of the indicators </title>
<unit> people </unit>
<item>
<name> Index One </name>
<value>50</value>
<description>1</description>
</item>
<item >
<name> Index 252 </name>
<value>50</value>
<description>2</description>
</item>
<item>
<name> Index Three </name>
<value>50</value>
<description>3</description>
</item>
<item>
<name> Index Four </name>
<value>50</value>
<description>4</description>
</item>
<item>
<name> Index Five </name>
<value>50</value>
<description>5</description>
</item>
<item>
<name> Index Six </name>
<value>10</value>
<description>6</description>
</item>
<item>
<name> Index Seven </name>
<value>50</value>
<description>7</description>
</item>
<item>
<name> Index Eight </name>
<value>50</value>
<description>8</description>
</item>
</items>
Template documentation
Copy Code code as follows:
<?xml version= "1.0" encoding= "Utf-8"?>
<template rootname= "DIV" >
<attribute name= "Style" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
$System. Event.EventManager.attachEvent
(
$$ ("#ctrlid #"), "AfterRender",
Function (Sender)
{
var cMenu = new $System. Ui.contextmenu ($$ ("#ctrlid #"). Domid);
Alert (2);
$$ ("#ctrlid #"). Addchildnode (Cmenu.guid, true);
$$ ("#ctrlid #"). $ $secret. Codebehind.cmenuguid = Cmenu.guid;
var srcdoc = new $System. XML.XMLUtil.XDOC ("root");
var tpldoc = $System. XML.XMLUtil.loadXMLFile ("Res\\app\\module\\style\\contextmenu.tpl.xml");
Cmenu.hide ();
Cmenu.render (Srcdoc, Tpldoc);
}
)
$$ ("#ctrlid #"). $ $secret. Codebehind.showitemdetail = function (ItemName, Itemvalue, itempercent)
{
alert ();
var cMenu = $$ ($$ (LEFTFRAMEGUID). $ $secret. Codebehind.cmenuguid);
$ (cmenu.guid + "_detail"). InnerHTML = $System. String.StringUtil.decodeURIComponent (detail);
Alert ($ (cmenu.guid + "_detail"). InnerHTML);
Cmenu.show (Window.event.x, WINDOW.EVENT.Y);
}
$$ ("#ctrlid #"). $ $secret. Codebehind.sectoronmouseover = function (Domid, startangle, offsetangle, angle, radius)
{
$ (domid). Path = "M0,0l0,0xe";
Window.settimeout ("$ (' + Domid +"). Path = ' m0,0ae0,0,1000,1000, + startangle +, ' + Offsetangle + Xe ', "JAVASC Ript ");
}
$$ ("#ctrlid #"). $ $secret. codebehind.sectoronmouseout = function (Domid, startangle, offsetangle, angle, radius)
{
$ (domid). Path = "M0,0l0,0xe";
Window.settimeout ("$ (' + Domid +"). Path = ' m0,0ae0,0,850,850, + startangle +, ' + Offsetangle + Xe ', "Javascri PT ");
}
//
Chart height, width
var pcontainer = $$ ("#ctrlid #"). Getdomobject ();
var w = pContainer.style.pixelWidth;
var h = pContainer.style.pixelHeight;
Alert (h);
if (H < W) {
H = h < (w * 5/6)? H:math.floor (w * 5/6);
}
else{
H = Math.floor (w * 5/6);
}
var hv = Math.min (W, h);
var rad = Math.floor (2 * HV/5);
Alert (RAD);
var radius = 1000;
$$ ("#ctrlid #"). $ $secret. Codebehind.radius = radius;
$$ ("#ctrlid #"). $ $secret. Codebehind.rad = rad;
Number of sectors
var itemnodelist = $$ ("#sdocguid #"). getElementsByTagName ("item");
$$ ("#ctrlid #"). $ $secret. Codebehind.sectorcount = itemnodelist.length;
var namelengtharray = [];
var maxitemnamelength, Cnamelength;
if ($$ ("#ctrlid #"). $ $secret. Codebehind.sectorcount!= 0) {
for (iteri = 0; iteri < $$ ("#ctrlid #"). $ $secret. codebehind.sectorcount; iteri + +) {
Cnamelength = $System. String.StringUtil.getLengthInCn (Itemnodelist.item (iteri). getElementsByTagName ("name"). Item (0). Text);
Namelengtharray.push (cnamelength);
}
Maxitemnamelength = Namelengtharray.sort
(
function (A, b) {
if (a = = b) {
return 0;
}
if (a > B) {
return 1;
}
return-1;
}
) [Namelengtharray.length-1];
}
$$ ("#ctrlid #"). $ $secret. codebehind.maxitemnamelength = maxitemnamelength;
Chart background size
var bgleft = Math.floor (w-2 * Rad-math.ceil (RAD/9)-Math.ceil (RAD/10)-(MAXITEMNAMELENGTH/10) * rad)/2);
alert (bgleft);
var bgtop = Math.floor (RAD/7);
alert (bgtop);
var bgwidth = 2 * RAD;
var bgheight = 2 * RAD;
$$ ("#ctrlid #"). $ $secret. codebehind.bg = {bgleft:bgleft, bgtop:bgtop, Bgwidth:bgwidth, bgheight:bgheight};
Current sector start angle
$$ ("#ctrlid #"). $ $secret. codebehind.cstartangle = 0;
$$ ("#ctrlid #"). $ $secret. Codebehind.angleoffset = 0;
$$ ("#ctrlid #"). $ $secret. CODEBEHIND.CSN = null;
$$ ("#ctrlid #"). $ $secret. codebehind.cindex = 1000;
var Strstyle;
Strstyle = "border:1px solid red;position:relative;left:0px;top:" + Math.floor ((pcontainer.style.pixelheight-h)/2) + " Px;width: "+ W +" Px;height: "+ H +" px;overflow:visible; ";
alert (Strstyle);
]]>
</statement>
</expression>
</attribute>
<foreach base= "/item" >
<element name= "V:shape" >
<attribute name= "Coordorigin" value= " -1000,-1000"/>
<attribute name= "coordsize" value= "2000,2000"/>
<attribute name= "stroked" value= "false"/>
<attribute name= "Fill" value= "true"/>
<element name= "V:fill" >
<attribute name= "Rotate" value= "true"/>
<attribute name= "angle" value= "180"/>
<attribute name= "Focus" value= "100%"/>
<attribute name= "type" value= "gradient"/>
<attribute name= "Color" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
</paramlist>
<statement>
<! [cdata[
var SN;
if ($$ ("#ctrlid #"). $ $secret. CODEBEHIND.CSN = = null) {
$$ ("#ctrlid #"). $ $secret. CODEBEHIND.CSN = 0;
}
else{
$$ ("#ctrlid #"). $ $secret. codebehind.csn++;
}
sn = $$ ("#ctrlid #"). $ $secret. CODEBEHIND.CSN;
var totalcount = $$ ("#ctrlid #"). $ $secret. Codebehind.sectorcount;
Compute color.
var ar = $System. UI.ColorUtil.genColorArrayOnItemNum (TotalCount, 1, 0.7);
Scolor = "RGB (" + AR[SN].R + "" + AR[SN].G + "" + ar[sn].b + ")";
]]>
</statement>
</expression>
</attribute>
<attribute name= "Color2" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
</paramlist>
<statement>
<! [cdata[
var SN;
sn = $$ ("#ctrlid #"). $ $secret. CODEBEHIND.CSN;
var totalcount = $$ ("#ctrlid #"). $ $secret. Codebehind.sectorcount;
Compute color.
var ar = $System. UI.ColorUtil.genColorArrayOnItemNum (TotalCount, 0.5, 1);
Scolor = "RGB (" + AR[SN].R + "" + AR[SN].G + "" + ar[sn].b + ")";
]]>
</statement>
</expression>
</attribute>
</element>
<attribute name= "path" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var sn = $$ ("#ctrlid #"). $ $secret. CODEBEHIND.CSN;
var cldnodelist = $System. XML.XMLUtil.XElement.getElementChildsByTagName ($$ ("#sdocguid #"). DocumentElement, "item") ;
var totalcount = $$ ("#ctrlid #"). $ $secret. Codebehind.sectorcount;
var totalvalue = 0;
var valueArray = [];
var cvalue;
Compute startangle and Endangle. Degree * (2^16)
for (var ai = 0; ai < totalcount ai + +) {
Cvalue = parsefloat ($System. XML.XMLUtil.XElement.getFirstElementChildByTagName (Cldnodelist[ai], "value"). Firstchild.nodevalue);
Valuearray.push (Cvalue);
Totalvalue + = Cvalue;
}
var startangle = 0;
var angleoffset = 0;
for (var ai = 0; ai < totalCount-1 ai + +) {
if (sn!= ai) {
StartAngle + = (ai% 2 = 0)? Math.floor (Valuearray[ai]/totalvalue * 360 * 65536): Math.ceil (Valuearray[ai]/totalvalue * 360 * 65536);
}
else{
Angleoffset = (ai% 2 = 0)? Math.floor (Valuearray[ai]/totalvalue * 360 * 65536): Math.ceil (Valuearray[ai]/totalvalue * 360 * 65536));
Break
}
}
if (sn = = (totalCount-1)) {
Angleoffset = 360 * 65536-startangle;
}
$$ ("#ctrlid #"). $ $secret. Codebehind.cstartangle = startangle;
$$ ("#ctrlid #"). $ $secret. Codebehind.angleoffset = Angleoffset;
Construct the path attribute value.
var spath;
spath = "m0,0ae0,0,850,850," + StartAngle + "," + Angleoffset + "XE";
]]>
</statement>
</expression>
</attribute>
<!--
<v:extrusion on= "T" type= "parallel" backdepth= "25px" color= "#20c11b" diffusity= "1.2" metal= "T" rotationangle= "20,0 "skewangle=" 90,0 "/>
-->
<element name= "V:extrusion" >
<attribute name= "on" value= "T"/>
<attribute name= "type" value= "parallel"/>
<attribute name= "Backdepth" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var str;
str = Math.floor ($$ ("#ctrlid #"). $ $secret. CODEBEHIND.RAD/8);
]]>
</statement>
</expression>
</attribute>
<attribute name= "type" value= "parallel"/>
<attribute name= "Color" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var SN;
sn = $$ ("#ctrlid #"). $ $secret. CODEBEHIND.CSN;
var totalcount = $$ ("#ctrlid #"). $ $secret. Codebehind.sectorcount;
Compute color.
var ar = $System. UI.ColorUtil.genColorArrayOnItemNum (TotalCount, 1, 0.7);
Scolor = "RGB (" + AR[SN].R + "" + AR[SN].G + "" + ar[sn].b + ")";
]]>
</statement>
</expression>
</attribute>
<attribute name= "Metal" value= "T"/>
<attribute name= "RotationAngle" value= "20,0"/>
<attribute name= "Skewangle" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var Skewangle;
Skewangle = 90;
]]>
</statement>
</expression>
</attribute>
</element>
<attribute name= "Style" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var Strstyle;
Strstyle = "border:0px solid red;position:absolute;left:" + $$ ("#ctrlid #"). $ $secret. Codebehind.bg.bgLeft + "Px;top:" + $ $ ("#ctrlid #"). $ $secret. Codebehind.bg.bgTop + "Px;width:" + $$ ("#ctrlid #"). $ $secret. Codebehind.bg.bgWidth + "PX; Height: "+ $$ (" #ctrlid # "). $ $secret. Codebehind.bg.bgHeight +" PX; ";
alert (Strstyle);
var startangle = $$ ("#ctrlid #"). $ $secret. codebehind.cstartangle/65536;
if (startangle = = 0) {
Strstyle + = "Z-index:" + $$ ("#ctrlid #"). $ $secret. Codebehind.cindex;
}
else if (StartAngle < && startangle > 0) {
Strstyle + = "Z-index:" + (--$$ ("#ctrlid #"). $ $secret. Codebehind.cindex);
}
else if (startangle >=90 && startangle < 270) {
$$ ("#ctrlid #"). $ $secret. Codebehind.cindex + + 2;
Strstyle + = "Z-index:" + $$ ("#ctrlid #"). $ $secret. Codebehind.cindex;
}
else{
Strstyle + = "Z-index:" + (--$$ ("#ctrlid #"). $ $secret. Codebehind.cindex);
}
]]>
</statement>
</expression>
</attribute>
<attribute name= "id" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var domid = $System. GenGUID ();
Domid;
]]>
</statement>
</expression>
</attribute>
<attribute name= "onmouseover" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#titleid #" Path= "." Attr= "id" tdoc= "t"/>
</paramlist>
<statement>
<! [cdata[
var startangle = $$ ("#ctrlid #"). $ $secret. Codebehind.cstartangle;
var offsetangle = $$ ("#ctrlid #"). $ $secret. Codebehind.angleoffset;
var angleline = ($$ ("#ctrlid #"). $ $secret. Codebehind.cstartangle + $$ ("#ctrlid #"). $ $secret. CODEBEHIND.ANGLEOFFSET/2) /65536;
var str;
str = "$$ (' #ctrlid # '). $ $secret. Codebehind.sectoronmouseover (' #titleid # '," + StartAngle + "," + Offsetangle + "," + A Ngleline + "," + $$ ("#ctrlid #"). $ $secret. Codebehind.rad + ")";
alert (str);
]]>
</statement>
</expression>
</attribute>
<attribute name= "onmouseout" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#titleid #" Path= "." Attr= "id" tdoc= "t"/>
</paramlist>
<statement>
<! [cdata[
var angleline = ($$ ("#ctrlid #"). $ $secret. Codebehind.cstartangle + $$ ("#ctrlid #"). $ $secret. CODEBEHIND.ANGLEOFFSET/2) /65536;
var str;
str = "$$ (' #ctrlid # '). $ $secret. Codebehind.sectoronmouseout (' #titleid # '," + StartAngle + "," + Offsetangle + "," + an Gleline + "," + $$ ("#ctrlid #"). $ $secret. Codebehind.rad + ")";
]]>
</statement>
</expression>
</attribute>
</element>
</foreach>
<!--draw the legend start-->
<element name= "div" >
<attribute name= "Style" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var pcontainer = $$ ("#ctrlid #"). Getdomobject ();
var Strstyle;
var h = pcontainer.style.pixelheight-math.floor ($$ ("#ctrlid #"). $ $secret. Codebehind.rad/4)-Math.floor ($$ ("#ctrlid # "). $ $secret. CODEBEHIND.RAD/8);
var L = $$ ("#ctrlid #"). $ $secret. Codebehind.bg.bgLeft + $$ ("#ctrlid #"). $ $secret. Codebehind.bg.bgWidth + Math.ceil ($$ (" #ctrlid # "). $ $secret. CODEBEHIND.RAD/10);
var w = Math.ceil ($$ ("#ctrlid #"). $ $secret. Codebehind.maxitemnamelength/8) * $$ ("#ctrlid #"). $ $secret. Codebehind.rad + Math.ceil ($$ ("#ctrlid #"). $ $secret. CODEBEHIND.RAD/12);
Strstyle = "Border:solid 0px #FF0000;p osition:absolute;left:" + L + "Px;top:" + Math.floor ($$ ("#ctrlid #"). $$ SECRET.CODEBEHIND.RAD/4) + "Px;width:" + W + "Px;height:" + H + "px;";
]]>
</statement>
</expression>
</attribute>
<element name= "Table" >
<attribute name= "Height" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var pcontainer = $$ ("#ctrlid #"). Getdomobject ();
var h;
h = Pcontainer.style.pixelheight-math.floor ($$ ("#ctrlid #"). $ $secret. Codebehind.rad/4)-Math.floor ($$ ("#ctrlid #"). $ $secret. CODEBEHIND.RAD/8);
]]>
</statement>
</expression>
</attribute>
<attribute name= "Border" value= "0"/>
<attribute name= "Align" value= "right"/>
<element name= "TR" >
<element name= "TD" >
<attribute name= "Align" value= "left"/>
<attribute name= "valign" value= "Middle"/>
<element name= "Table" >
<attribute name= "Border" value= "0"/>
<attribute name= "Height" value= "1"/>
<attribute name= "cellpadding" value= "0"/>
<attribute name= "cellspacing" value= "0"/>
<foreach base= "/item" >
<element name= "TR" >
<element name= "TD" >
<attribute name= "align" value= "center"/>
<attribute name= "valign" value= "Middle"/>
<attribute name= "Height" value= "1"/>
<element name= "div" >
<attribute name= "Style" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var Strstyle;
var hw = Math.floor ($$ ("#ctrlid #"). $ $secret. CODEBEHIND.RAD/10);
Strstyle = "margin:0px;position:relative;top:0px;left:0px;border:0px solid #FF0000; width:" + HW + "Px;height:" + HW + "PX; padding:0px; ";
]]>
</statement>
</expression>
</attribute>
<element name= "V:shape" >
<attribute name= "Style" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var Strstyle;
var hw = Math.floor ($$ ("#ctrlid #"). $ $secret. CODEBEHIND.RAD/10);
Strstyle = "Margin:0px;position:absolute;top:0px;left:0px;width:" + HW + "Px;height:" + HW + "px;";
]]>
</statement>
</expression>
</attribute>
<attribute name= "path" value= "M 0,0 l 0,100 100,100 100,0 x e"/>
<attribute name= "Coordorigin" value= "0,0"/>
<attribute name= "coordsize" value= "100,100"/>
<element name= "V:fill" >
<attribute name= "Rotate" value= "true"/>
<attribute name= "angle" value= "180"/>
<attribute name= "Focus" value= "100%"/>
<attribute name= "type" value= "gradient"/>
<attribute name= "Color" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
if ($$ ("#ctrlid #"). $ $secret. Codebehind.samplei = = null) {
$$ ("#ctrlid #"). $ $secret. Codebehind.samplei = 0;
}
var Scolor;
var sn = $$ ("#ctrlid #"). $ $secret. Codebehind.samplei;
var totalcount = $$ ("#ctrlid #"). $ $secret. Codebehind.sectorcount;
Compute color.
var ar = $System. UI.ColorUtil.genColorArrayOnItemNum (TotalCount, 1, 0.7);
$$ ("#ctrlid #"). $ $secret. Codebehind.ccolumnfillcolor = AR[SN].R + "," +AR[SN].G + "," +AR[SN].B;
Scolor = "RGB (" + AR[SN].R + "" + AR[SN].G + "" + ar[sn].b + ")";
]]>
</statement>
</expression>
</attribute>
<attribute name= "Color2" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var Scolor;
var sn = $$ ("#ctrlid #"). $ $secret. Codebehind.samplei;
var totalcount = $$ ("#ctrlid #"). $ $secret. Codebehind.sectorcount;
Compute color.
var ar = $System. UI.ColorUtil.genColorArrayOnItemNum (TotalCount, 0.5, 1);
$$ ("#ctrlid #"). $ $secret. Codebehind.ccolumnfillcolor = AR[SN].R + "," +AR[SN].G + "," +AR[SN].B;
$$ ("#ctrlid #"). $ $secret. codebehind.samplei++;
Scolor = "RGB (" + AR[SN].R + "" + AR[SN].G + "" + ar[sn].b + ")";
]]>
</statement>
</expression>
</attribute>
</element>
</element>
</element>
</element>
<element name= "TD" >
<attribute name= "Height" value= "1"/>
<attribute name= "width" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var ww;
WW = Math.max (Math.floor ($$ ("#ctrlid #"). $ $secret. Codebehind.rad/30), 5);
]]>
</statement>
</expression>
</attribute>
<attribute name= "Style" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var Strstyle;
var hw = Math.floor ($$ ("#ctrlid #"). $ $secret. CODEBEHIND.RAD/8);
Strstyle = "Margin:0px;padding:0px;height:" + HW + "px;line-height:1px;";
]]>
</statement>
</expression>
</attribute>
<element name= "br"/>
</element>
<element name= "TD" >
<attribute name= "Height" value= "1"/>
<attribute name= "Align" value= "left"/>
<attribute name= "valign" value= "Middle"/>
<attribute name= "nowrap" value= "true"/>
<attribute name= "Style" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var fs = Math.ceil ($$ ("#ctrlid #"). $ $secret. Codebehind.rad/15) > 9? Math.ceil ($$ ("#ctrlid #"). $ $secret. Codebehind.rad/15): 9;
Strstyle = "Padding:0px;margin:0px;height:1px;line-height: + FS +" Px;font-size: "+ FS +" Px;font-weight:bold; font-family: ' Microsoft yahei ', Simhei,helvetica,stheiti,georgia, ' Times New Roman ', times, serif;
]]>
</statement>
</expression>
</attribute>
<text path= "./name"/>
</element>
</element>
</foreach>
</element>
</element>
</element>
</element>
</element>
<!--draw Legend End-->
<element name= "div" >
<attribute name= "Style" expression= "true" >
<expression>
<paramlist>
<param name= "#ctrlid #" path= "/" attr= "Controlguid"/>
<param name= "#sdocguid #" path= "/" attr= "GUID"/>
</paramlist>
<statement>
<! [cdata[
var w = $$ ("#ctrlid #"). Getdomstyle ("Pixelwidth");
var h = Math.floor ($$ ("#ctrlid #"). $ $secret. CODEBEHIND.RAD/6);
var fs = h > 14? h:14;
Strstyle = "Padding-top:" + Math.floor (FS/4) + "Px;font-size:" + fs + "Px;text-align:center;border:solid 0px #FF0000;p os Ition:absolute;left:0px;top:0px;width: "+ W +" Px;height: "+ (fs + Math.floor (FS/4)) +" Px;line-height "+ (fs + Math.flo or (FS/4)) + "px;font-weight:bold;font-family: ' Microsoft yahei ', Simhei,helvetica,stheiti,georgia, ' Times New Roman ', times, serif; ";
]]>
</statement>
</expression>
</attribute>
<text path= "/title"/>
</element>
</template>
Convert code
Copy Code code as follows:
var ctrl1 = new $System. Ui.control ("div005");
var srcdoc = $System. XML.XMLUtil.loadXMLFile ("Ria09\\style\\xmls\\graph_src.xml");
var tpldoc = $System. XML.XMLUtil.loadXMLFile ("Ria09\\style\\xmls\\graph_3dpie_tpl.xml");
Ctrl1.rendere (Srcdoc, Tpldoc);
Conversion results
Code download