Chart analysis with VML (including column, pie chart and folding)

zhaozj2021-02-12  137

</ title> <style> v /: * {behavior: URL (# default # VML)} / * declaration V is VML variable * / </ style> </ head></p> <p><body οnlοad = "initvrml ();">></p> <p><script> // Simulation Data Var RecordsetArray = New Array (); // The number of simulation records VAR IRecordCount = 20; for (IIndex = 0; IIndex <IRecordCount; IIndex ) {var unitArray = new array (); unitRray [0 ] = IIndex; UnitArray [1] = math.Round (Math.rand () * 1000); RecordSetArray [IIndex] = UnitArray;} // Simulation data Y axis maximum [Ran] var IRecordmaxx = 20; // Simulation data X-axis maximum [Range] VAR IRecordmaxy = 1000; // Simulation data y-axis maximum [Ran] // Coordinate system var iscreenwidth = 400; // Real width pxvar iscreenheight = 400; // Real height PXVAR icoordsizex = 4000; // Separate the width var icoordsizey = 4000; // Separate the height var iCoordsizestep = 200; // Coordination shaft and margin var IRECTSIZE = 100; // Column chart cylindrical width var VGROUP = null; // VRML zone function line (IRecordcount ) {VRMLID.innerHTML = ""; InitVRML (); CoordSize (); CoordSizeLine (); var iFromX = iCoordSizeStep; var iFromY = 0; for (iIndex = 0; iIndex <iRecordCount; iIndex ) {var vLine = document.createElement ("v: line"); vLine.Style.Left = "0"; VLINE.Style.top = "0"; vLine.From = "" iFromx "," iFromy ""; iFromx = icoordsizestep Math.Round (INDSetArray [INDEX] [0] * (icoordsizex-icoordsizestep) / IRecordmaxx); ifromy = math.round (RecordsetArray [IIndex] [1] * (icoordsizey-icoord SiZESTEP) / IRECORDMAXY); VLINE.TO = "'" iFromx "," IFROMY "'"; VLINE.STROKECOLOR = "# 000000"; VLINE.STROKEWEIGHT = "1"; vline.title = "Simulated data" RecordsetArray [IIndex] [0] "Bar"; // var vStroke = Document.createElement ("v: stroke"); //vstroke.endarrow="classic "; //vstroke.startarrow="oval"; / /VLINE.APpendChild (Vstroke); vgroup.Appendchild (VLINE);}} Function Circle (IRecordcount) {vrmlid.innerhtml =</p> <p>""; Initvrml (); var var malmax = math.pow (2, 16) * 360; var vtotal = 1; var vStartangle = 0; var vendangle = 0; var vpreangle = 0; for (Kindex = 0; Kindex <IRecordcount ; kIndex ) {vTotal = RecordSetArray [kIndex] [1];} for (iIndex = 0; iIndex <iRecordCount; iIndex ) {var vShape = document.createElement ( "v: shape"); vStartAngle = vPreAngle; vPreAngle = RecordSetArray [ iIndex] [1] / vTotal; vEndAngle = RecordSetArray [iIndex] [1] /vTotal;vShape.style.width=iCoordSizeX-2*iCoordSizeStep; vShape.style.height = iCoordSizeY-2 * iCoordSizeStep; vShape.style.top = Icoordsizestep; vshape.style.left = icoordsizestep; vshape.strokecolor = "black"; vshape.fillcolor = randcolor ();</p> <p>vshape.path = "m 2000 2000 AE 2000 2000 2000" PARSEINT (Varmax * vStartangle) "" PARSEINT (VARMAX * VENDANGLE) "XE"; vshape.title = " RecordsetArray [IIndex] [0 ] "Block"; vshape._scale = parseint (360 * (vStartangle vendangle / 2)); vgroup.Appendchild (vshape);}} function bar (irecordcount) {vrmlid.innerhtml = "; initvrml (); coordsize (); CoordSizeLine (); var iStep = Math.round (iCoordSizeX / iRecordCount); for (iIndex = 1; iIndex <iRecordCount; iIndex ) {var iRnd = Math.round (Math.random () * (iCoordSizeY-iCoordSizeStep) VAR VRECT = Document.createElement ("v: Rect"); VRECT.Style.style.Left = ISTEP * IINDEX; VRECT.Style.top = (icoordsizey-icoordsizestep) -Math.Round (RecordsetArray [IIndex] [1] * (iCoordSizeY-iCoordSizeStep) / iRecordMaxY); vRect.style.width = iRectSize; vRect.style.height = Math.round (RecordSetArray [iIndex] [1] * (iCoordSizeY-iCoordSizeStep) / iRecordMaxY); vRect.fillColor = "# Eeeeee "; VRECT.TITLE =" Simulated Data " RecordsetArray [IIndex] [0] " Y-axis "; vgroup.Appendchild (vRect);}}}} Function Drawlinesx (iMaxx, Object) {var istep = Math .Round (icoordsizex / imaxx); for (var IIndex = 1; IIndex <= iMaxx; IIndex ) {var Vline = Document.createElement ("v: line"); Vline.FROM = istep * IINDEX "," (iCoordsizey) -ICOORDSIZESTEP); VLINE.TO = ISTEP * IINDEX "," (icoordsizestep / 2); var vStroke = document.createElement ("v: stroke"); vStroke.endarrow = "diamond"; vStroke.dashstyle = "dot"; Vline.Appendchild (vStroke); object.Appendchild (VLINE);}} Function Drawlinesy (iMaxy, Object) {var istep =</p> <p>Math.Round (icoordsizey / imaxy); for (var IIndex = 0; IIndex <iMaxy; IIndex ) {var VLINE = Document.createElement ("v: line"); vline.from = icoordsizestep "," istep * IIndex; VLINE.TO = math.Round (icoordsizestep / 2) "," istep * IIndex; var vStroke = document.createElement ("v: stroke"); vStroke.ndarrow = "diamond"; vStroke.dashstyle = "dot" ; vLine.appendChild (vStroke); Object.appendChild (vLine);}} function InitVRML () {VRMLID.innerHTML = ""; vGroup = document.createElement ( "v: group"); vGroup.style.width = iScreenWidth " px "; vGroup.style.height = iScreenHeight " px "; vGroup.coordsize = iCoordSizeX ", " iCoordSizeY; var vRect = document.createElement (" v: rect "); vRect.style.width = iCoordSizeX " px "; VRect.Style.Height = ICOORDSIZEY "PX"; VRECT.FILLCOLOR = "# ffffff"; vRect.StrokeColor = "# 000000"; var vshadow = document.createElement ("v: shadow"); vshadow.on = "True" Vshadow.type = "single"; vshadow.color = "Silver"; vshadow.offset = "5pt, 5pt"; VRECT.APpendChild (vshadow); vgroup.Appendchild (vRect);</p> <p>VRMLID.appendChild (vGroup);} function CoordSize () {var vLineX = document.createElement ( "v: line"); vLineX.from = iCoordSizeStep "," iCoordSizeStep; vLineX.to = iCoordSizeStep "," (iCoordSizeY- iCoordSizeStep); var vStrokeX = document.createElement ( "v: stroke"); vStrokeX.startArrow = "classic"; vStrokeX.endArrow = "oval"; vStrokeX.dashStyle = "single"; vLineX.appendChild (vStrokeX); vGroup. Appendchild (VLINEX);</p> <p>var vLineY = document.createElement ( "v: line"); vLineY.from = iCoordSizeStep "," (iCoordSizeY-iCoordSizeStep); vLineY.to = (iCoordSizeX-iCoordSizeStep) "," (iCoordSizeY-iCoordSizeStep); var vStrokeY = document.createElement ( "v: stroke"); vStrokeY.startArrow = "oval"; vStrokeY.endArrow = "classic"; vStrokeY.dashStyle = "single"; vLineY.appendChild (vStrokeY); vGroup.appendChild (vLineY) ;} function CoordSizeLine () {DrawLinesX (RecordSetArray.length, vGroup); DrawLinesY (RecordSetArray.length, vGroup);} function RandColor () {return "rgb (" parseInt (Math.random () * 255) ", " PARSEINT (Math.random () * 255) " " PARSEINT (Math.random () * 255) ") ";} Function Zoom (Ivalue) {var Varx = 4000; var Varx = 4000; VGROUP .coordsize = parseint (varX / iValue) "," PARSEINT (VARSEINT (VARY / IVALUE);} </ script> <center> <input type = "初n =" initial setting "οnclick =" initvrml (); " > <input type = "Button" Value = "histogram" οnclick = "bar (recordsetArray.length);"> <input type = "Button" value = "pie chart" οnclick = "Circle (RecordsetArray.length);" > <input type = "Button" value = "fold line diagram" οnclick = "line (RE CordsetArray.Length) "> <select οnchange =" zoom (this.value)> <option value = "0.2" SELECTED> 20% </ option> <option value = "0.25> 25% </ option> <option Value = "0.4"> 40% </ option> <option value = "0.5"> 50% </ option> <option value = "0.75"> 75% </ option> <</p> <p>Option value = "0.8"> 80% </ option> <option value = "1"> Original size </ option> <option value = "1.25"> 125% </ option> <option value = "1.5"> 150 % </ option> <option value = "2"> 200% </ option> <option value = "3"> 300% </ option> <option value = "4"> 400% </ option> </ select > <br> <br> <div id = VRMLID> </ div> </ center> </ body> </ html></p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-6656.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="6656" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.047</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'ra2GNlcQXHoTXsvKEPrQNfCfPqLVelSg6q65FgoD5zNo6shNDu55CzstUvFNTZATUlCTTFv09JSu8C6JwNxZtg_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>