<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>David's Computer Stuff Journal: Chartr - Plotr generation for Rails</title>
    <link>http://journal.dedasys.com/articles/2007/10/30/chartr-plotr-generation-for-rails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Chartr - Plotr generation for Rails</title>
      <description>&lt;p&gt;I've been working on a &lt;a href="http://www.langpop.com"&gt;project&lt;/a&gt; that uses graphics created with &lt;a href="http://solutoire.com/plotr/"&gt;Plotr&lt;/a&gt;, and I wanted to automate that from Rails, so I created &lt;a href="http://chartr.rubyforge.org/"&gt;Chartr&lt;/a&gt;.  It's not very complete, but works well enough to create stuff like this:&lt;/p&gt;

&lt;hr/&gt;

&lt;p&gt;&lt;script src="http://chartr.rubyforge.org/prototype1_5_1_1.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="http://chartr.rubyforge.org/excanvas.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="http://chartr.rubyforge.org/plotr_uncompressed.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;&lt;div class="chart"&gt;
      &lt;canvas id="results_chart" height="300" width="500"&gt;&lt;/canvas&gt;
    &lt;/div&gt;&lt;/p&gt;

&lt;script type="text/javascript"&gt;
var dataset = {"Number/Decade": [[0, 1000], [1, 5000], [2, 20000], [3, 22000]]};
var options = {colorScheme: "#22aa22", legend: {position: {}}, axis: {x: {ticks: [{label: "1960", v: 0}, {label: "1970", v: 1}, {label: "1980", v: 2}, {label: "1990", v: 3}]}}, padding: {left: 100}, background: {}, stroke: {}, legend: {position: {left: '120px'}}};
var discvar = new Plotr.BarChart("results_chart", options);
discvar.addDataset(dataset);
discvar.render();
&lt;/script&gt;

&lt;hr/&gt;

&lt;p&gt;Help is more than welcome!  I think the API is still a bit clumsy, more chart types need adding, and there are other things that could probably be improved, but it does work.&lt;/p&gt;</description>
      <pubDate>Tue, 30 Oct 2007 08:15:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:ff569c5f-e2ef-48ff-b50a-899b8fb4650f</guid>
      <author>David N. Welton</author>
      <link>http://journal.dedasys.com/articles/2007/10/30/chartr-plotr-generation-for-rails</link>
      <category>ruby</category>
      <category>rails</category>
      <category>javascript</category>
      <trackback:ping>http://journal.dedasys.com/articles/trackback/1816</trackback:ping>
    </item>
  </channel>
</rss>
