<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: JRuby + JFreeChart = Sparklines</title>
	<atom:link href="http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/feed/" rel="self" type="application/rss+xml" />
	<link>http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/</link>
	<description>Keith on XML, Publishing, Ruby, Birds, &#038; San Francisco</description>
	<pubDate>Thu, 04 Dec 2008 00:28:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>By: punk21</title>
		<link>http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-119</link>
		<dc:creator>punk21</dc:creator>
		<pubDate>Wed, 18 Jun 2008 04:22:31 +0000</pubDate>
		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-119</guid>
		<description>Hey guys, Having problem while drawing Sparkline Charts then chk this out &lt;a href="http://visifire.com" rel="nofollow"&gt;visifire&lt;/a&gt; an amazing charting component which is powered by silverlight offered under open source</description>
		<content:encoded><![CDATA[<p>Hey guys, Having problem while drawing Sparkline Charts then chk this out <a href="http://visifire.com" rel="nofollow">visifire</a> an amazing charting component which is powered by silverlight offered under open source</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: slonkak</title>
		<link>http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-118</link>
		<dc:creator>slonkak</dc:creator>
		<pubDate>Thu, 17 Apr 2008 18:40:02 +0000</pubDate>
		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-118</guid>
		<description>Would you be so kind as to help our a Ruby/Java noob?  Say I just created a default, blank rails app in my jRuby install.  I have the jfreechart and jcommon JARs in my classpath.  What all do I  have to do to get your code to work and start producing charts.  I don't know Ruby (nor the MVC framework), I don't know Java, and I most certainly don't know how Java works with jRuby.  I would like to learn, but since I learn by example, and most examples on the net are very incomplete, I'm having a hard time.  Could you provide any assistance?</description>
		<content:encoded><![CDATA[<p>Would you be so kind as to help our a Ruby/Java noob?  Say I just created a default, blank rails app in my jRuby install.  I have the jfreechart and jcommon JARs in my classpath.  What all do I  have to do to get your code to work and start producing charts.  I don&#8217;t know Ruby (nor the MVC framework), I don&#8217;t know Java, and I most certainly don&#8217;t know how Java works with jRuby.  I would like to learn, but since I learn by example, and most examples on the net are very incomplete, I&#8217;m having a hard time.  Could you provide any assistance?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-106</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Thu, 12 Jul 2007 14:23:45 +0000</pubDate>
		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-106</guid>
		<description>What's the actual error you're getting/can you post more of the code you're using?

&lt;a href="http://kfahlgren.com/blog/2007/07/12/stacked-bar-charts-in-jruby-using-jfreechart/" rel="nofollow"&gt;Hope this helps&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>What&#8217;s the actual error you&#8217;re getting/can you post more of the code you&#8217;re using?</p>
<p><a href="http://kfahlgren.com/blog/2007/07/12/stacked-bar-charts-in-jruby-using-jfreechart/" rel="nofollow">Hope this helps</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mdweezer</title>
		<link>http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-105</link>
		<dc:creator>mdweezer</dc:creator>
		<pubDate>Thu, 12 Jul 2007 12:28:26 +0000</pubDate>
		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-105</guid>
		<description>Keith,

I appreciate the response, I kept getting "addValue" incorrect method errors...  I'm building stacked bar charts with the data.  I'm using data scraped from a database, I just used those values to figure out how to actually add data to the dataset.  Not quite sure what I was doing wrong but I"ll see what I can do.  Again, I appreciate it, thanks!</description>
		<content:encoded><![CDATA[<p>Keith,</p>
<p>I appreciate the response, I kept getting &#8220;addValue&#8221; incorrect method errors&#8230;  I&#8217;m building stacked bar charts with the data.  I&#8217;m using data scraped from a database, I just used those values to figure out how to actually add data to the dataset.  Not quite sure what I was doing wrong but I&#8221;ll see what I can do.  Again, I appreciate it, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-104</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Wed, 11 Jul 2007 22:40:03 +0000</pubDate>
		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-104</guid>
		<description>mdweezer:

I haven't the foggiest idea what you're actually trying to do, but:

&lt;pre&gt;# Mostly inspired by http://left.subtree.org/2007/01/15/creating-sparklines-with-jfreechart/
# have JFreeChart in your classpath, obviously, as well as jcommon.jar
require 'java'

module Graph
  class Sparkline
    include_class 'java.io.File'
    include_class 'org.jfree.chart.ChartUtilities'
    include_class 'org.jfree.chart.JFreeChart'
    include_class 'org.jfree.data.category.DefaultCategoryDataset'
    include_class 'org.jfree.chart.ChartFactory'
    include_class 'org.jfree.chart.plot.PlotOrientation'

    def initialize(width=200, height=80, data=[])
      @width = width
      @height = height
      dataset = create_sample_data() if data.empty?
      @chart = create_chart(dataset)
    end

    def render_to_file(filename, format="png")
      javafile = java.io.File.new(filename)
      ChartUtilities.saveChartAsPNG(javafile, @chart, @width, @height)
    end

    private
    def create_sample_data
      dataset = DefaultCategoryDataset.new
      dataset.addValue(1, "Closed", "")
      dataset.addValue(1, "InVerfication", "")
      dataset.addValue(2, "Delivered", "")
      dataset.addValue(2, "On-hold", "")
      dataset.addValue(3, "In-work", "")
      dataset.addValue(3, "Rejected", "")
      dataset.addValue(3, "Duplicate", "")
      dataset.addValue(3, "Assigned", "")
      dataset.addValue(4, "Submitted", "")

      return dataset
    end

    def create_chart(dataset)
      chart = ChartFactory.createWaterfallChart("Phase","Name", "", dataset, PlotOrientation::VERTICAL, true, true, false)
      return chart    
    end
  end # class Sparkline  
end # class Graph

sp = Graph::Sparkline.new
puts "Rendering sparkline"
sp.render_to_file("sparkline.png")&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>mdweezer:</p>
<p>I haven&#8217;t the foggiest idea what you&#8217;re actually trying to do, but:</p>
<pre># Mostly inspired by <a href="http://left.subtree.org/2007/01/15/creating-sparklines-with-jfreechart/" rel="nofollow">http://left.subtree.org/2007/01/15/creating-sparklines-with-jfreechart/</a>
# have JFreeChart in your classpath, obviously, as well as jcommon.jar
require &#8216;java&#8217;

module Graph
  class Sparkline
    include_class &#8216;java.io.File&#8217;
    include_class &#8216;org.jfree.chart.ChartUtilities&#8217;
    include_class &#8216;org.jfree.chart.JFreeChart&#8217;
    include_class &#8216;org.jfree.data.category.DefaultCategoryDataset&#8217;
    include_class &#8216;org.jfree.chart.ChartFactory&#8217;
    include_class &#8216;org.jfree.chart.plot.PlotOrientation&#8217;

    def initialize(width=200, height=80, data=[])
      @width = width
      @height = height
      dataset = create_sample_data() if data.empty?
      @chart = create_chart(dataset)
    end

    def render_to_file(filename, format=&#8221;png&#8221;)
      javafile = java.io.File.new(filename)
      ChartUtilities.saveChartAsPNG(javafile, @chart, @width, @height)
    end

    private
    def create_sample_data
      dataset = DefaultCategoryDataset.new
      dataset.addValue(1, &#8220;Closed&#8221;, &#8220;&#8221;)
      dataset.addValue(1, &#8220;InVerfication&#8221;, &#8220;&#8221;)
      dataset.addValue(2, &#8220;Delivered&#8221;, &#8220;&#8221;)
      dataset.addValue(2, &#8220;On-hold&#8221;, &#8220;&#8221;)
      dataset.addValue(3, &#8220;In-work&#8221;, &#8220;&#8221;)
      dataset.addValue(3, &#8220;Rejected&#8221;, &#8220;&#8221;)
      dataset.addValue(3, &#8220;Duplicate&#8221;, &#8220;&#8221;)
      dataset.addValue(3, &#8220;Assigned&#8221;, &#8220;&#8221;)
      dataset.addValue(4, &#8220;Submitted&#8221;, &#8220;&#8221;)

      return dataset
    end

    def create_chart(dataset)
      chart = ChartFactory.createWaterfallChart(&#8221;Phase&#8221;,&#8221;Name&#8221;, &#8220;&#8221;, dataset, PlotOrientation::VERTICAL, true, true, false)
      return chart
    end
  end # class Sparkline
end # class Graph

sp = Graph::Sparkline.new
puts &#8220;Rendering sparkline&#8221;
sp.render_to_file(&#8221;sparkline.png&#8221;)</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: mdweezer</title>
		<link>http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-103</link>
		<dc:creator>mdweezer</dc:creator>
		<pubDate>Wed, 11 Jul 2007 17:58:34 +0000</pubDate>
		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/04/13/jruby-jfreechart-sparklines/#comment-103</guid>
		<description>Have you done anything with DefaultCategoryDatasets?  I'm trying to build some stacked bar charts in JRuby and your code is excellent but I can't seem to make things work with other types of datasets, grrrrr.  But then again, my Ruby isn't exactly sharp.

The following chunk of code is what I need to port over...

DefaultCategoryDataset result = new DefaultCategoryDataset();
result.addValue(0, "Closed", "");
result.addValue(0, "InVerfication", "");
result.addValue(0, "Delivered", "");
result.addValue(0, "On-hold", "");
result.addValue(0, "In-work", "");
result.addValue(0, "Rejected", "");
result.addValue(0, "Duplicate", "");
result.addValue(0, "Assigned", "");
result.addValue(0, "Submitted", "");</description>
		<content:encoded><![CDATA[<p>Have you done anything with DefaultCategoryDatasets?  I&#8217;m trying to build some stacked bar charts in JRuby and your code is excellent but I can&#8217;t seem to make things work with other types of datasets, grrrrr.  But then again, my Ruby isn&#8217;t exactly sharp.</p>
<p>The following chunk of code is what I need to port over&#8230;</p>
<p>DefaultCategoryDataset result = new DefaultCategoryDataset();<br />
result.addValue(0, &#8220;Closed&#8221;, &#8220;&#8221;);<br />
result.addValue(0, &#8220;InVerfication&#8221;, &#8220;&#8221;);<br />
result.addValue(0, &#8220;Delivered&#8221;, &#8220;&#8221;);<br />
result.addValue(0, &#8220;On-hold&#8221;, &#8220;&#8221;);<br />
result.addValue(0, &#8220;In-work&#8221;, &#8220;&#8221;);<br />
result.addValue(0, &#8220;Rejected&#8221;, &#8220;&#8221;);<br />
result.addValue(0, &#8220;Duplicate&#8221;, &#8220;&#8221;);<br />
result.addValue(0, &#8220;Assigned&#8221;, &#8220;&#8221;);<br />
result.addValue(0, &#8220;Submitted&#8221;, &#8220;&#8221;);</p>
]]></content:encoded>
	</item>
</channel>
</rss>
