<?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>Cloud Connected &#187; chart</title>
	<atom:link href="http://www.cloudconnected.fr/tag/chart/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cloudconnected.fr</link>
	<description>Thoughts of a french web developer</description>
	<lastBuildDate>Wed, 01 Feb 2012 08:53:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Google Chart PHP Library 0.4</title>
		<link>http://www.cloudconnected.fr/2010/05/15/google-chart-php-library-0-4/</link>
		<comments>http://www.cloudconnected.fr/2010/05/15/google-chart-php-library-0-4/#comments</comments>
		<pubDate>Sat, 15 May 2010 08:20:37 +0000</pubDate>
		<dc:creator>Rémi</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[googlechart]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.cloudconnected.fr/?p=599</guid>
		<description><![CDATA[I released a new version of my PHP library for Google Chart API. Remember it&#8217;s still in heavy development (well, depending on my free time and my motivation, so &#8220;heavy&#8221; is relative), therefore don&#8217;t except anything bug-free or feature complete. Less rigid API Until this version, I was focusing on implementing strictly the Google Chart [...]]]></description>
			<content:encoded><![CDATA[<p>I released a new version of <a href="/2010/04/28/announcing-googlechart-php-library-0-3/">my PHP library for Google Chart API</a>. Remember it&#8217;s still in heavy development (well, depending on my free time and my motivation, so &#8220;heavy&#8221; is relative), therefore don&#8217;t except anything bug-free or feature complete.</p>
<h3>Less rigid API</h3>
<p>Until this version, I was focusing on implementing strictly the Google Chart API. However, I eventually realize that the API is sometimes too rigid. For example, say you want to hide an axis. You have to specify &#8220;<code>_</code>&#8221; (underscore) as the 5th value (<code>axis_or_tick</code>) in the <code>chxs</code> parameter (values are separated by a coma). Looks easy right? Except it is NOT ok to omit the first 4th values. So you have to specify the <code>label_color</code>, <code>font_size</code> and <code>alignment</code> before, in order to be able to hide your axis.</p>
<p>In version 0.3, you had to do exactly that, by using <code>setStyle</code> and specifying the 4th parameter (<code>$axis_or_tick</code>). If you wonder why it&#8217;s not the 5th, it&#8217;s because the &#8220;axis index&#8221; value is calculated on runtime. Fortunatly, you could pass <code>null</code> as the value for the parameter, and the library will replace them by the default value. Example:</p>
<pre>
$axis = new GoogleChartAxis('x');
$axis->setStyle(null, null, null, '_');
</pre>
<p>In version 0.4, the <code>setStyle</code> method as been removed and splitted into multiple methods <code>setLabelColor</code>, <code>setFontSize</code>, <code>setLabelAlignment</code>, <code>setDrawLine</code>, <code>setDrawTickMarks</code> and <code>setTickColor</code>. Now you don&#8217;t need to worry about how many parameter you have to set, just call the method you want and the library will take care of setting the appropriate intermediate values. Example:</p>
<pre>
$axis = new GoogleChartAxis('x');
$axis->setDrawLine(false)->setDrawTickMarks(false);
</pre>
<h3>More abstraction</h3>
<p>This version also comes up with a set of features to simplify chart creation. For example, one of my favorite is <code>setBorder</code> method for Shape Markers (<code>GoogleChartShapeMarker</code>).</p>
<p>To create a border in a shape with Google Chart API, you need to create another similar marker below the first one (think z-order), with a different color and a slightly bigger size. Well, this can be done exactly this way in version 0.3. However, starting version 0.4, the <code>setBorder</code> method does the job for you. Just specify a color and the size of the border, and it will create the second marker automatically. Not only this is more convenient and easy to write, but this is also faster and uses less memory.</p>
<h3>New features</h3>
<p>This version adds support for Dynamic Icon. Because icons can be either &#8220;freestanding&#8221; (used as a chart) or used as marker, I had to refactor the base class. Now the base class is <code>GoogleChartApi</code> which holds the logic to query the API. <code>GoogleChart</code> and <code>GoogleChartIcon</code> extends this class, so you can use a <code>GoogleChartIcon</code> exactly the same way as a chart.</p>
<p>Example:</p>
<pre>
require '../lib/icons/GoogleChartIconNote.php';

$chart = new GoogleChartIconNote('Hello world');
$chart->setTitle('Example');
$chart->setTextColor('D01F3C');

header('Content-Type: image/png');
echo $chart;
</pre>
<p>To use a icon as a marker, use the new <code>addDynamicMarker</code> method. Example:</p>
<pre>
require '../lib/GoogleChart.php';
require '../lib/icons/GoogleChartIconNote.php';

$values = array();
for ($i = 0; $i &lt;= 10; $i += 1) {
	$values[] = rand(20,80);
}

$chart = new GoogleChart('ls', 500, 200);
$data = new GoogleChartData($values);
$chart->addData($data);

$marker = new GoogleChartIconNote('Hello');
$marker->setData($data);
$chart->addDynamicMarker($marker);

header('Content-Type: image/png');
echo $chart;
</pre>
<p>For the moment, only &#8220;note&#8221; icon (aka <a href="http://code.google.com/intl/fr-FR/apis/chart/docs/gallery/dynamic_icons.html#fun_style_note" rel="nofollow">Fun style notes with text and optional title</a>) are supported, but I&#8217;m working on it.</p>
<h3>Hey, the project has a new home!</h3>
<p>Yes, the project is now hosted by Google Code. Because there is already a shitload of abandonned projects named using every possible combinations of &#8220;google&#8221; &#8220;chart&#8221; and &#8220;php&#8221;, I had to use the (rather long) name &#8220;googlechartphplib&#8221;. So new home is here:<br />
<a href="http://code.google.com/p/googlechartphplib">http://code.google.com/p/googlechartphplib</a>. You&#8217;ll find source code, issue tracker, documentation and the new SVN access there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudconnected.fr/2010/05/15/google-chart-php-library-0-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

