<?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>Doga Berntas &#187; gchart</title>
	<atom:link href="http://doganberktas.com/tag/gchart/feed/" rel="self" type="application/rss+xml" />
	<link>http://doganberktas.com</link>
	<description>is actually from a small planet somewhere in the vicinity of Betelgeuse</description>
	<lastBuildDate>Sat, 21 Apr 2012 21:48:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>A Simple Chart for a GWT Application on GAE/J</title>
		<link>http://doganberktas.com/2009/12/19/a-simple-chart-for-a-gwt-application-on-gaej/</link>
		<comments>http://doganberktas.com/2009/12/19/a-simple-chart-for-a-gwt-application-on-gaej/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 02:41:17 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[gchart]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[Google Web Toolkit]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[gwt 2.0]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Web development software]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=147</guid>
		<description><![CDATA[I am trying charting solutions for a GWT project and gchart seems a nice one. After some digging I create a sample project which is hosted on Google App Engine (GAE) demo. Source code is at Google project The chart will show the remaining number of months in the current year. First download the jar [...]]]></description>
			<content:encoded><![CDATA[<p>I am trying charting solutions for a GWT project and gchart seems a nice one. After some digging I create a sample project which is hosted on Google App Engine (GAE) <a href="http://ghart-samples.appspot.com/">demo</a>. Source code is at <a href="https://dogansartifacts.googlecode.com/svn/trunk/GoogleAppEngineJava/GChart-samples">Google project</a></p>
<p>The chart will show the remaining number of months in the current year.</p>
<ul>
<li>First download the jar from the project home page http://code.google.com/p/gchart/</li>
<li>Put it under war/WEB-INF/lib and add the gchart.jar to your classpath</li>
<li>Create a  Web Application project called it GChart-samples (I assume you have Google Eclipse Plugin and follow the basic steps from <a href="http://code.google.com/eclipse/docs/getting_started.html">here</a>)</li>
<li>This step is for make-up, find GChart_samples.html under war/WEB-INF and clear the part between &lt;body&gt; tags.</li>
<li>Open GChart_samples.gwt.xml and add the following line
<pre>&lt;inherits name='com.googlecode.gchart.GChart'/&gt;</pre>
</li>
<li>Create a class in client folder called FirstChart and change it as the following
<pre>package com.dogan.kaya.client;

import com.googlecode.gchart.client.GChart;

public class FirstChart extends GChart
{
	public FirstChart()
	{
		setChartSize(350, 350);

		addCurve();

		int[] data = { 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
		for (int i = 0; i &lt; data.length; i++)
		{
			getCurve().addPoint(i + 1, data[i]);
		}
		//curve customization
		getCurve().getSymbol().setHeight(10);
		getCurve().getSymbol().setWidth(10);
		getCurve().getSymbol().setBorderColor("black");
		getCurve().getSymbol().setBorderWidth(3);
		getCurve().getSymbol().setSymbolType(SymbolType.LINE);
		getCurve().getSymbol().setFillThickness(2);
		getCurve().getSymbol().setFillSpacing(0);
		//chart customization
		getXAxis().setAxisMin(1);
		getXAxis().setAxisMax(12);
		getXAxis().setTickCount(12);
		getXAxis().setHasGridlines(false);
		getXAxis().setTickLocation(TickLocation.CENTERED);
		getXAxis().setTickLabelFontSize(10);
		getYAxis().setAxisMin(0);
		getYAxis().setAxisMax(12);
		//to get inteter values on y axis, be careful
		//about the number of intervals it can be tricky
		getYAxis().setTickCount(13);
		getYAxis().setTicksPerLabel(2);
		getYAxis().setHasGridlines(false);
		getYAxis().setTickLabelFontSize(10);
		//
		update();
	}
}</pre>
</li>
<li>Open GChart_samples class and change it like the following
<pre>package com.dogan.kaya.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class GChart_samples implements EntryPoint
{
	public void onModuleLoad()
	{
		RootPanel.get().add(new FirstChart());
	}
}</pre>
</li>
<li>My output is sth like that</li>
</ul>
<p><a href="../wp-content/uploads/2009/12/chart1.jpg"></a><a href="http://doganberktas.com/wp-content/uploads/2009/12/chart11.jpg"><img class="alignnone size-full wp-image-154" title="chart1" src="http://doganberktas.com/wp-content/uploads/2009/12/chart11.jpg" alt="" width="361" height="199" /></a></p>
<p>ps:</p>
<p>some nice links about gchart are as follows:</p>
<ol>
<li style="text-align: justify;">gchart <a href="http://code.google.com/p/gchart/">homepage</a></li>
<li style="text-align: justify;">A simple tutorial at http://whatwouldnickdo.com/wordpress/264/simple-charts-in-gwt-with-gchart/</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2009/12/19/a-simple-chart-for-a-gwt-application-on-gaej/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

