<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mindtrove &#187; visualization</title>
	<atom:link href="http://mindtrove.info/tag/visualization/feed/" rel="self" type="application/rss+xml" />
	<link>http://mindtrove.info</link>
	<description>Collecting ideas since 1980</description>
	<lastBuildDate>Thu, 01 Jul 2010 01:58:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Dojo 1.1 Charting</title>
		<link>http://mindtrove.info/dojo-11-charting/</link>
		<comments>http://mindtrove.info/dojo-11-charting/#comments</comments>
		<pubDate>Mon, 26 May 2008 03:22:30 +0000</pubDate>
		<dc:creator>Peter Parente</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[graphing]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://mindtrove.info/?p=53</guid>
		<description><![CDATA[Dojo has a charting module capable of rendering a few different types of graphs. Here's an example rendering of one sine and cosine period in SVG. The code is straightforward: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 [...]]]></description>
			<content:encoded><![CDATA[<p>Dojo has a charting module capable of rendering a few different types of graphs. Here's an example rendering of one sine and cosine period in SVG.</p>
<p><iframe src="/html/dojo-charting.html" style="width:100%; height:450px; border: 0px solid white; overflow: none;"></iframe></p>
<p>The code is straightforward:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Dojo 1.1 Charting Example<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/scripts/dojo/dojo.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
&nbsp;
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
        dojo.require(&quot;dojox.charting.Chart2D&quot;);
        dojo.require(&quot;dojox.charting.themes.PlotKit.blue&quot;);
        dojo.addOnLoad(function() {
          var period = 2 * Math.PI;
          var tick = Math.PI / 180.0;
          var step = 5*Math.PI / 180.0;
          var id = 'chart_area';
&nbsp;
          var chart = new dojox.charting.Chart2D(id);
          chart.setTheme(dojox.charting.themes.PlotKit.blue);
          chart.addAxis(&quot;x&quot;, {min: 0, max: period, majorTickStep: tick*30, 
                              minorTickStep: tick*10, minorLabels: false});
          chart.addAxis(&quot;y&quot;, {vertical: true, min: -1.01, max: 1, majorTickStep: 0.5, 
                              minorTickStep: 0.1, minorLabels: false});
          chart.addPlot(&quot;default&quot;, {type: 'Lines'});
          chart.addPlot(&quot;grid&quot;, {type: &quot;Grid&quot;, vMinorLines: true});
&nbsp;
          var series = {'sin' : [], 'cos' : []};
          for(var i = 0; i <span style="color: #009900;">&lt; period; i+<span style="color: #66cc66;">=</span>step<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">              series.sin.push<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">'x'</span> : i, <span style="color: #ff0000;">'y'</span> : Math.sin<span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">              series.cos.push<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">'x'</span> : i, <span style="color: #ff0000;">'y'</span> : Math.cos<span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">          <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #009900;">          chart.addSeries<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'sin'</span>, series.sin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">          chart.addSeries<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'cos'</span>, series.cos<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">          chart.render<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">        <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">    &lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;chart_area&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 100%; height: 400px;&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Basic animations are possible by invoking <code>chart.updateSeries(name, data);</code>. The result is pretty smooth in Safari, but eats a ton of CPU if done with a delay under 50ms. There also appears to be a lack of support for controlling updates to other chart features such as axes in the 1.1 version.</p>
<p>Other features I have yet to find (possibly because they don't exist) include labels for axes, legends, chart titles, and a simple way to set event handlers for various chart components and actions.</p>
]]></content:encoded>
			<wfw:commentRss>http://mindtrove.info/dojo-11-charting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
