<?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>charts &#8211; martinklinke.com</title>
	<atom:link href="https://www.martinklinke.com/tag/charts/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.martinklinke.com</link>
	<description>IT&#039;s my business</description>
	<lastBuildDate>Wed, 18 Feb 2009 22:25:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Speedometer with JFreeChart in Eclipse</title>
		<link>https://www.martinklinke.com/2009/02/18/speedometer-with-jfreechart-in-eclipse/</link>
					<comments>https://www.martinklinke.com/2009/02/18/speedometer-with-jfreechart-in-eclipse/#comments</comments>
		
		<dc:creator><![CDATA[Martin Klinke]]></dc:creator>
		<pubDate>Wed, 18 Feb 2009 22:25:18 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[visualization]]></category>
		<guid isPermaLink="false">http://www.martinklinke.com/?p=51</guid>

					<description><![CDATA[There is a great tutorial on vogella.de describing how to add a pie chart with JFreeChart to an Eclipse RCP application or plug-in. The ChartFactory that is used to create the pie chart does not include a method to create a speedometer (or dial) as shown in the sample section of JFreeChart. The following code [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>There is a great tutorial on <a href="http://www.vogella.de">vogella.de</a> describing how to <a title="JFreeChart in Eclipse RCP" href="http://www.vogella.de/articles/EclipseJFreeChart/article.html">add a pie chart with JFreeChart to an Eclipse RCP application or plug-in</a>. The ChartFactory that is used to create the pie chart does not include a method to create a speedometer (or dial) as shown in the <a title="JFreeChart Samples" href="http://www.jfree.org/jfreechart/samples.html">sample section of JFreeChart</a>. The following code fragment creates a view that displays a very basic speedometer using the <strong>org.jfree.chart.plot.MeterPlot</strong> class:</p>
<pre lang="Java">package com.martinklinke.eclipse.jfreechart.demo.views;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.MeterPlot;
import org.jfree.data.general.DefaultValueDataset;
import org.jfree.experimental.chart.swt.ChartComposite;

/**
* @author martin
*
*/
public class MeterChartView extends ViewPart {
   public static final String ID = "com.martinklinke.eclipse.jfreechart.demo.views.MeterChartView";

   public void createPartControl(Composite parent) {
      JFreeChart chart = createChart();
      final ChartComposite frame = new ChartComposite(parent, SWT.NONE, chart, true);
   }

   public void setFocus() {
   }

   /**
    * Creates the Chart based on a dataset
    */
   private JFreeChart createChart() {
      DefaultValueDataset data = new DefaultValueDataset(20.0);
      MeterPlot plot = new MeterPlot(data);
      JFreeChart chart = new JFreeChart("Meter Chart",
      JFreeChart.DEFAULT_TITLE_FONT, plot, false);
      plot.setNoDataMessage("No data available");
      return chart;
   }
}</pre>
<p>The result should look like the following screenshot:</p>
<div id="attachment_59" style="width: 579px" class="wp-caption alignnone"><a href="https://www.martinklinke.com/wp-content/uploads/2009/02/speedometer.jpg"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-59" class="size-full wp-image-59" title="speedometer" src="https://www.martinklinke.com/wp-content/uploads/2009/02/speedometer.jpg" alt="JFreeChart Speedometer in Eclipse View" width="569" height="329" srcset="https://www.martinklinke.com/wp-content/uploads/2009/02/speedometer.jpg 569w, https://www.martinklinke.com/wp-content/uploads/2009/02/speedometer-300x173.jpg 300w" sizes="(max-width: 569px) 100vw, 569px" /></a><p id="caption-attachment-59" class="wp-caption-text">JFreeChart Speedometer in Eclipse View</p></div>
<p>Of course, the MeterPlot can be further customized by calling the plot.setXXX(&#8230;) methods. However, this exercise is left to the willing reader ;)</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.martinklinke.com/2009/02/18/speedometer-with-jfreechart-in-eclipse/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
