VML line diagram (1)

zhaozj2021-02-08  207

This example is aimed at the monthly output of one of a certain factory, and VML technology is applied to draw a simple production chart in the browser customer area.

The mainly used VML elements of this example are:

combined graphics, establish a graphics coordinate system.

Customize element type.

Establish the drawing section.

draw path.

calculate the expression.

Display text.

Below is the data used in this example:

Month 1 2 3 4 5 6 7 8 9 10 11 12 12 A 345 156 156 156 154 148 155 156 159 159 159 161 B 365 303 283 353 347 316 333 344 362 362 362 374

After drawing through the customer district, the effect in the browser is as follows:

Figure 16.8 Simple product chart

Code:

Yield Trend </ Title></p> <p><Style> v /: * {behavior: URL (# default # vml);</p> <p><! --标 轴 pattern-à</p> <p>.axisline {left: 0px; width: 400px; position: absolute; top: 0px; height: 400px}</p> <p><! - Graphic Group style -></p> <p>.grp {margin-top: 50pt; z-index: 200; margin-left: 50pt; width: 400px; position: absolute; height: 200px}</p> <p><! - Coordinate axis Y style -></p> <p>.oytext: -10px; width: 425px; Position: absolute; top: -10px; height: 415px}</p> <p><! - Define Y-axis Base -></p> <p>. l l}}}}}};;;;;;;;</p> <p><! - Define Data Parker Style -></p> <p>y {Left: 0px; Width: 400px; Position: absolute; top: 0px; height: 400px}</p> <p>.TexTright {LEFT: -10PX; Width: 425px; Position: absolute; top: -10px; height: 415px}</p> <p>.Text2 {font-size: 10pt; Left: auto; margin-left: 372.281pt; width: 102.062pt; Top: auto; height: 14pt; text-align: left}</p> <p>. ot s a}}}}}}}}}}}}}}}}}}}}}};;;;;;;;;;;;;;;;;;;;</p> <p><! - Definition Legend Style -></p> <p>Lend {left: -10px; width: 425px; Position: absolute; top: -55px; height: 415px}</p> <p>{Margin-top: 4.093pt; font-size: 10pt; Left: auto; margin-left: 287.062pt; width: 98.25pt; top: auto; height: 11.062pt; text-align: left} <! - Define head styles -></p> <p>{margin-top: 0pt; ip: auto; margin-left: 0pt; width: 100%; Top: auto; height: 30pt; text-align: center}</p> <p></ Style></p> <p></ HEAD></p> <p><Body></p> <p><! - Define Graphic Boundary -></p> <p><v: group class = "GRP" Coordsize = "400, 400"></p> <p><v: TextBox class = "head"> Simple yield chart </ v: text></p> <p><! - Define Coordination axis type -></p> <p><v: shapetype id = Axisline strokeweweight = "1pt" path = "m @ 0 @ 1 l @ 2 @ 3 e" adj = "0, 0, 400, 400"></p> <p><v: pat arrowok = "f"> </ v: path></p> <p><v: stroke endarrow = "classic" endarrowwidth = "narrow" endarrowLength = "long"> </ v: stroke></p> <p><v: Formulas></p> <p><v: f eqn = "SUM # 0 0 0"> </ V: f></p> <p><v: f eqn = "SUM # 1 0 0"> </ V: f></p> <p><v: f EQn = "SUM # 2 0 0"> </ V: f></p> <p><v: f eqn = "SUM # 3 0 0"> </ V: f></p> <p></ v: formulas></p> <p><! - Note: The # 0, 1, 2, 3 here is the first, 2nd, 3, 4 values ​​of the parent element (V: shapety) Adj attribute -></p> <p></ v: shapetype></p> <p><! - coordinate area -></p> <p><! - y -></p> <p><v: shape class = "axisline" type = "# Axisline" COORDSIZE = "400, 400" adj = "0,400,0,0"> </ v: shape></p> <p><! - x -></p> <p><v: shape class = "axisline" type = "# Axisline" COORDSIZE = "400, 400" adj = "0,400,400,400"> </ v: shape></p> <p><! - Draw Water Level -></p> <p><v: shapetype id = yline coordsize = "400, 400" strokecolor = "# ccc" path = "m0 @ 3 l @ 0 @ 3 e"> <v: formulas></p> <p><v: f eqn = "SUM 400 0 0"> </ V: f></p> <p><v: f eqn = "SUM 0 # 0 1"> </ v: f></p> <p><v: f eqn = "prod 1 height # 1"> </ v: f></p> <p><v: f eqn = "prod @ 1 @ 2 1"> </ v: f></p> <p><v: f eqn = "sum 0 0 0"> </ v: f></p> <p><v: f eqn = "SUM 0 @ 3 0"> </ v: f></p> <p><v: f eqn = "sum 0 0 0"> </ v: f></p> <p><v: f eqn = "sum @ 3 0 0"> </ v: f></p> <p></ v: formulas></p> <p>The second half http://www.9cbs.net/develop/read_article.asp?id=19135</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-2287.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="2287" 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.048</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 = 'iD_2BQtdG6udktkwnZ_2BCEgTzrk48KK8h8NdPD7rUupmAZhokI8OdYAjEidB_2BI4SbeomhxdAfSRxvq4_2BFiydnMMYQ_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>