Monday, September 22, 2014

Indicate the title and the shadow effect // cycle var strMessage =


Been used in various fields chart (Chart), and the like that is effective to visualize or performance goals and future potential for growth and Sales such yiraseo particularly effective for indicating a relationship between a number of particular data. In creating these charts to help create various types of charts (Chart) to you of HTML5 elements (Element) Canvas element. Learn bars (bar), the way the pie (pie) chart (chart) for making various types of charts from here using the Canvas. Create a bar chart (bar chart) to make the first bar (bar) in the form of charts, but already covered in canvas back part is explained to know how to create a rectangle (Rectangle) by default, and it can be made using the following format: .
<Html> <head> <meta http-equiv = "Content-Type" content = "text / html; charset = ko"> <title> chart </ title> <style> #chartcanvas {margin-top: 0px; margin-left: 20px; margin-right: 0; margin-bottom: 0px; border: 1px solid red; padding: 0; } </ Style> </ script> </ head> <body> <canvas id = "chartcanvas" width = "550" height = "400"> </ canvas> </ body> </ html>
Save to "sellbarchart.html" set outside the margin (margin) and margins (padding) inside the canvas element with the id attribute value of that chartcanvas name above it. And the red lines indicate the canvas area and then look at the connection to the browser, atlanta population save only To actually atlanta population represent the underlying data in a bar graph form requires you to use the second half of 2012 the monthly sales of smartphones agency as follows: atlanta population
<Script type = "text / javascript"> window.onload = function () {var canvas = document.getElementById ("chartcanvas"); var context = canvas.getContext ("2d"); atlanta population var sw = canvas.width; var sh = canvas.height; var sell_count = [95, 73, 85, 45, 72, 32]; var barwidth = 60; var barheight; var xcoord = 40; var base = 90; for (var i = 0; i <sell_count.length; i ++) {barheight = sell_count [i]; DrawBarchart (context, "blue", xcoord, (sh-barheight) -base, barwidth, barheight); xcoord + = barwidth + 10; //} Draw a rectangle (Rectangle) function function DrawBarchart (context, fillstyleColor, xcoord, ycoord, width, height) {context.fillStyle = fillstyleColor; context.fillRect (xcoord, ycoord, width, height); }} </ Script>
Indicate the title and the shadow effect // cycle var strMessage = "2H12 phone sales report"; context.textAlign = "center"; context.fillStyle = "black"; context.shadowColor = "rgba (0,0,0,0.5)"; context.shadowOffsetX atlanta population = 1; context.shadowOffsetY = 1; context.shadowBlur = 3; context.font = "16pt Century Gothic"; context.fillText atlanta population (strMessage, sw / 2, 60); // X, y coordinate of the line to show var LINE_PADDING = 30; context.moveTo (LINE_PADDING, LINE_PADDING); context.lineTo (LINE_PADDING, sh-LINE_PADDING * 3); context.lineTo (sw-LINE_PADDING, sh-LINE_PADDING * 3); var stepSize = 10; Unit sales for the // y coordinates context.font = "12pt Century Gothic"; for (var i = 0; i <18; i ++) {context.moveTo (LINE_PADDING, LINE_PADDING + i * stepSize); atlanta population if (i == 0) {context.lineTo (LINE_PADDING * 0.5, LINE_PADDING + i * stepSize); context.fillText (180- (i * 10), LINE_PADDING * 0.5, LINE_PADDING + i * stepSize + 8); } Else if (i == 8) {context.lineTo (LINE_PADDING * 0.5, LINE_PADDING + i * stepSize); context.fillText (180- (i * 10), LINE_PADDING * 0.5, LINE_PADDING atlanta population + i * stepSize + 8); } Else if (i == 13) {context.lineTo (LINE_PADDING * 0.5, LINE_PADDING + i * stepSize); context.fillText (180- (i * 10), LINE_PADDING * 0.5, LINE_PADDING + i * stepSize + 8); } & N

No comments:

Post a Comment