| 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" > |
| 4 | <head> |
| 5 | <title>PlotKit.Canvas | liquidx</title> |
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 7 | <link href="http://media.liquidx.net/css/x_general.css" media="screen" rel="Stylesheet" type="text/css" /> |
| 8 | <link href="http://media.liquidx.net/css/x_header.css" media="screen" rel="Stylesheet" type="text/css" /> |
| 9 | <link href="http://media.liquidx.net/css/x_layout.css" media="screen" rel="Stylesheet" type="text/css" /> |
| 10 | <link href="http://media.liquidx.net/css/x_blocks.css" media="screen" rel="Stylesheet" type="text/css" /> |
| 11 | <link rel="icon" href="/favicon.png" type="image/x-png"> |
| 12 | <link rel="shortcut icon" href="/favicon.png" type="image/x-png"> |
| 13 | <!--[if lt IE 7.]> |
| 14 | <script defer type="text/javascript" src="http://media.liquidx.net/js/pngfix.js"></script> |
| 15 | <![endif]--> |
| 16 | |
| 17 | <link href="doc.css" media="screen" rel="stylesheet" type="text/css" /> |
| 18 | |
| 19 | </head> |
| 20 | |
| 21 | <body> |
| 22 | <div id="header"> |
| 23 | <div id="logo"><a href="http://www.liquidx.net/"><img src="http://media.liquidx.net/imgx/logo.png" width="256" height="128" alt="liquidx.net" /></a></div> |
| 24 | <div id="menu-hack"> |
| 25 | <div id="menu-l"><img src="http://media.liquidx.net/imgx/menu_l.png" width="17" height="28" alt="menu cap" /></div><div id="menu-r"><img src="http://media.liquidx.net/imgx/menu_r.png" width="17" height="28" alt="menu cap" /></div> |
| 26 | <div id="menu-main"> |
| 27 | <ul id="menu" class="code"> |
| 28 | <li class="tab" id="blog"><a href="http://www.liquidx.net/" title="blog/home">blog</a></li> |
| 29 | <li class="tab" id="code"><a href="http://www.liquidx.net/code/" title="software i have written">software</a></li> |
| 30 | <li class="tab" id="dev"><a href="http://projects.liquidx.net/" title="source code for my open source projects">dev</a></li> |
| 31 | <li class="tab" id="photos"><a href="http://al.tse.id.au/gallery/" title="photos and videos">photos</a></li> |
| 32 | <li class="tab" id="research"><a href="http://al.tse.id.au/research/" title="research profile">research</a></li> |
| 33 | <li class="tab" id="links"><a href="http://www.liquidx.net/links/" title="my bookmarks">linkblog</a></li> |
| 34 | <li class="tab" id="stats"><a href="http://stats.liquidx.net/" title="stats for various parts of my website">stats</a></li> |
| 35 | <li class="tab" id="status"><a href="http://www.liquidx.net/status/" title="weather report for alastair">status</a></li> |
| 36 | <li class="tab" id="about"><a href="http://al.tse.id.au/" title="about alastair tse">aboutme</a></li> |
| 37 | </ul> |
| 38 | </div> |
| 39 | </div> |
| 40 | <div id="quickbuttons"> |
| 41 | <span class="quickbutton"><a href="http://www.liquidx.net/albumartwidget/"><img src="http://media.liquidx.net/imgx/quick_widget.png" alt="album art widget" /></a></span> |
| 42 | <span class="quickbutton"><a href="http://www.liquidx.net/plotkit/"><img src="http://media.liquidx.net/imgx/quick_plotkit.png" alt="plotkit" /></a></span> |
| 43 | <span class="quickbutton"><a href="http://www.liquidx.net/fruity/"><img src="http://media.liquidx.net/imgx/quick_fruity.png" alt="fruity" /></a></span> |
| 44 | </div> |
| 45 | |
| 46 | </div> |
| 47 | |
| 48 | <div id="body"> |
| 49 | <div class="page doc api"> |
| 50 | |
| 51 | <p> <a href="PlotKit.html">PlotKit Home</a> | <a href="PlotKit.SweetSVG.html"><<</a> |
| 52 | </p> |
| 53 | |
| 54 | <h1> PlotKit EasyPlot</h1> |
| 55 | <p>EasyPlot is a wrapper around the various PlotKit classes to allow you to get a chart plotted as quick as possible with as little code as possible. Using EasyPlot, you will get a chart started with just a single line. |
| 56 | </p> |
| 57 | |
| 58 | <h2> Constructor</h2> |
| 59 | <p> <code>PlotKit.EasyPlot(style, options, divElement, datasourceArray)</code> |
| 60 | </p> |
| 61 | <p>EasyPlot object will automatically choose the supported render method, currently Canvas or SVG in that order, and render the datasources given in <code>datasourceArray</code>. |
| 62 | </p> |
| 63 | |
| 64 | <h3> Arguments:</h3> |
| 65 | <ul> |
| 66 | <li> |
| 67 | <code>style</code> may be <code>line</code>, <code>bar</code> or <code>pie</code>. |
| 68 | </li> |
| 69 | |
| 70 | <li> |
| 71 | <code>options</code> is an associative dictionary that is the combined options of both <code>Layout</code> and <code>Renderer</code>. |
| 72 | </li> |
| 73 | |
| 74 | <li> |
| 75 | <code>divElement</code> is the container that the chart should be rendered in. It is best that the <code>width</code> and <code>height</code> attribute is set in the <code>DIV</code> element. |
| 76 | </li> |
| 77 | |
| 78 | <li> |
| 79 | <code>datasourceArray</code> is an array of data sources. The elements of the array can either be a two dimensional array given in <code>Plotkit.Layout.addDataset</code> or it can be a string that points to the relative URL of a comma separated data file. |
| 80 | </li> |
| 81 | </ul> |
| 82 | |
| 83 | <h2> EasyPlot Example</h2> |
| 84 | <pre><code><div id="example" style="margin: 0 auto 0 auto;" width="400" height="400"></div> |
| 85 | |
| 86 | <script type="text/javascript"> |
| 87 | var data = [[0,0], [1,2], [2,3], [3, 7], [4, 8], [5, 6]]; |
| 88 | var plotter = EasyPlot("line", {}, $("example"), [data, "sample.txt"]); |
| 89 | </script> |
| 90 | </code></pre><p>In this example, two datasets are passed, one defined as a 2D array and another which is a comma separated text file (CSV) at the location "sample.txt". A demonstration of this is found in the <a href="http://media.liquidx.net/js/plotkit-tests/quickstart-easy.html">QuickStartEasy</a> example. |
| 91 | </p> |
| 92 | |
| 93 | |
| 94 | </div> |
| 95 | </div> |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | <div id="footer"> |
| 101 | <div class="block"> |
| 102 | <h3>Syndication Feeds:</h3> |
| 103 | <p> |
| 104 | <ul class="tiny"> |
| 105 | <li><a href="http://www.liquidx.net/blog/feed/atom/" class="feed" title="feed for all posts on liquidx.net"><img src="http://media.liquidx.net/imgx/feed.gif" class="feed" alt="feed" />Atom Feed for the Blog Entries</a></li> |
| 106 | <li><a href="http://www.liquidx.net/blog/feed/rss/" class="feed" title="feed for all posts on liquidx.net"><img src="http://media.liquidx.net/imgx/feed.gif" class="feed" alt="feed" />RSS Feed for the Blog Entries</a></li> |
| 107 | <li><a href="http://www.liquidx.net/comments/feed/atom/" class="feed" title="feed for all posts on liquidx.net"><img src="http://media.liquidx.net/imgx/feed.gif" class="feed" alt="feed" />Feed for All Comments</a></li> |
| 108 | <li><a href="http://www.liquidx.net/links/feed/atom/" class="feed" title="feed for all bookmarked links"><img src="http://media.liquidx.net/imgx/feed.gif" class="feed" alt="feed" />Feed for Links</a></li> |
| 109 | </ul> |
| 110 | </p> |
| 111 | </div> |
| 112 | <div class="block"> |
| 113 | <h3>About this site:</h3> |
| 114 | <p>Content on this site is licensed under <a href="http://creativecommons.org/licenses/by/2.5/">CC By Attribution</a> unless otherwise specified. |
| 115 | Copyright (c) 2002-2006, <a href="http://al.tse.id.au/">Alastair Tse</a>.</p> |
| 116 | <p>For more information, see <a href="http://al.tse.id.au/">al.tse.id.au</a>.</p> |
| 117 | <p><script type="text/javascript" src="http://technorati.com/embed/itwctkzez.js"></script></p> |
| 118 | </div> |
| 119 | <div class="block"> |
| 120 | <h3>Is Made Possible By:</h3> |
| 121 | <p> |
| 122 | <dl> |
| 123 | <dt><a href="http://ecto.kung-foo.tv/" class="clean">ecto</a>. </dt> |
| 124 | <dd>Blogging client for Mac</dd> |
| 125 | <dt><a href="http://djangoproject.com/" class="clean">Django</a>. </dt> |
| 126 | <dd>Python Web Framework</dd> |
| 127 | <dt><a href="http://www.lighttpd.net/" class="clean">lighttpd</a>. </dt> |
| 128 | <dd>Really Fast Web Server</dd> |
| 129 | <dt><a href="http://www.saddi.com/software/flup/" class="clean">flup</a>. </dt> |
| 130 | <dd>FastCGI for Python</dd> |
| 131 | </dl> |
| 132 | </p> |
| 133 | </div> |
| 134 | <div class="block"> |
| 135 | <h3>Search My Sites:</h3> |
| 136 | <p> |
| 137 | <div style='margin: 10px; text-align: center; width: 160px;'><form action='http://www.rollyo.com/search.html' ><fieldset style='margin: 0; padding: 4px 0 0 0; height: 60px; border: none; background: url(http://rollyo.com/remote/togo-bg4.png) no-repeat top left;'><div style="position: absolute; float:left; z-index:99; width: 46px; height: 50px;"><a href="http://rollyo.com"><img style="border: none;" height="50" width="46" src="http://rollyo.com/remote/x.gif"></a></div> <input type='text' size='30' style='float: left; width: 90px; margin: 2px 0 0 48px; padding: 0; font-size: 12px;' name='q' value='Search...' onclick='this.value="";' /><br /> <select name='sid' style='float: left; width: 78px; height: 15px; margin: 12px 0 0 46px; font-size: 7pt; padding: 0;'><option value='106081' selected='selected'>liquidx</option><option value='web'>Search The Web</option></select><input type='image' src='http://rollyo.com/remote/btn-togo.png' alt='Go' style='margin: 12px 0 0 3px; float: left;' /><input type='hidden' name='togo-v' value='1' /></fieldset></form></div> |
| 138 | </p> |
| 139 | </div> |
| 140 | |
| 141 | |
| 142 | <div class="clear"> </div> |
| 143 | |
| 144 | </div> |
| 145 | |
| 146 | |
| 147 | |
| 148 | <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> |
| 149 | <script type="text/javascript"> |
| 150 | _uacct = "UA-58117-1"; |
| 151 | urchinTracker(); |
| 152 | </script> |
| 153 | |
| 154 | </body> |
| 155 | </html> |