<?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>de &#187; takpu</title>
	<atom:link href="http://duivesteyn.net/tag/takpu/feed/" rel="self" type="application/rss+xml" />
	<link>http://duivesteyn.net</link>
	<description></description>
	<lastBuildDate>Tue, 20 Apr 2010 22:00:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iPhone SDK &#8211; Implementing the Tapku Graph In your application</title>
		<link>http://duivesteyn.net/2010/03/07/iphone-sdk-implementing-the-tapku-graph-in-your-application/</link>
		<comments>http://duivesteyn.net/2010/03/07/iphone-sdk-implementing-the-tapku-graph-in-your-application/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 18:23:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK Tips]]></category>
		<category><![CDATA[charting]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[takpu]]></category>

		<guid isPermaLink="false">http://duivesteyn.net/2010/03/07/iphone-sdk-implementing-the-tapku-graph-in-your-application/</guid>
		<description><![CDATA[One of the simpler and nicer available graph controllers your iPhone app is from the Tapku library. The tapku library is created by the team at http://tapku.com/ at hosted at http://github.com/devinross/tapkulibrary. The graph view controller I find as a good mix between a simple SparkLine (http://key-solutions.ca/cksparkline.html) and the full-on core-plot. Implementing the whole Tapku library [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://duivesteyn.net/wp-content/uploads/2010/03/Screen-shot-2010-03-08-at-10.28.02.png" rel="lightbox[510]"><img class="size-full wp-image-512 alignright" title="Tapku GraphController Screenshot" src="http://duivesteyn.net/wp-content/uploads/2010/03/Screen-shot-2010-03-08-at-10.28.02.png" alt="" width="277" height="149" /></a>One of the simpler and nicer available graph controllers your iPhone app is from the Tapku library. The tapku library is created by the team at <a href="http://tapku.com/">http://tapku.com/</a> at hosted at <a href="http://github.com/devinross/tapkulibrary">http://github.com/devinross/tapkulibrary</a>.</p>
<p>The graph view controller I find as a good mix between a simple SparkLine (<a href="http://key-solutions.ca/cksparkline.html">http://key-solutions.ca/cksparkline.html</a>) and the full-on <a href="http://code.google.com/p/core-plot/">core-plot</a>.</p>
<p>Implementing the whole Tapku library is overkill to just use the chart and in fact can be a little difficult for beginners too.</p>
<p>To implement the graph follow the following steps:</p>
<p><img class="alignright" src="http://duivesteyn.net/wp-content/uploads/2010/03/Screenshot2010-03-08at10.05.25.OmxZv34TWnLc.jpg" alt="Screenshot2010-03-08at10.05.25.OmxZv34TWnLc.jpg" width="185" height="240" /></p>
<p><strong>1.Copy the following files out of the Tapku Library and copy into your project:</strong></p>
<p><strong><span style="font-weight: normal;">GraphController.h &amp; GraphController.m<br />
 TKGraphController.h &amp; TKGraphController.m<br />
 TKGraphView.h &amp; TKGraphView.m<br />
 TKGlobal.h &amp; TKGlobal.m<br />
 UIImageAdditions.h &amp; UIImageAdditions.m<br />
 UIViewAdditions.h &amp; UIImageAdditions.m<br />
 TapkuLibrary.bundle (for the graphics)</span></strong></p>
<p><strong><span style="font-weight: normal;"><strong>2. Add the framework QuartzCore</strong></span></strong></p>
<p><span style="color: #643820;"><span style="font-size: small;">#import </span></span><span style="color: #c41a16;"><span style="font-size: small;">&lt;QuartzCore/QuartzCore.h&gt;</span></span></p>
<p><span style="color: #c41a16;"><span style="font-size: small;"><br />
 </span></span></p>
<p><span style="font-size: 14pt; color: #c41a16;"> <span style="color: #000000; font-size: 13px;"><strong>3. In GraphController.h, remove the line to import the full Tapku Library and import TKGraphController.h and TKGraphView.h.</strong> </span></span></p>
<p><span style="font-size: 14pt; color: #c41a16;"><span style="color: #000000; font-size: 13px;">Alter GraphController.h to:</span><br />
 </span></p>
<p><span style="color: #007400;"><span style="font-size: small;">//#import &lt;TapkuLibrary/TapkuLibrary.h&gt;</span></span><span style="font-size: small;"><br />
 </span> <span style="color: #643820;"><span style="font-size: small;">#import </span></span><span style="color: #c41a16;"><span style="font-size: small;">&#8220;TKGraphController.h&#8221;</span></span><span style="font-size: small;"><br />
 </span> <span style="color: #643820;"><span style="font-size: small;">#import </span></span><span style="color: #c41a16;"><span style="font-size: small;">&#8220;TKGraphView.h&#8221;</span></span></p>
<p><span style="color: #c41a16;"><span style="font-size: small;"><br />
 </span></span></p>
<p><strong> ￼4. Now to call the graph, we display it as a modal view controller. Use the following code in your project to push the view onto the screen:</strong></p>
<p><span style="color: #643820;"><span style="font-size: small;">In your header file add:<br />
 #import </span></span><span style="color: #c41a16;"><span style="font-size: small;">&#8220;GraphController.h&#8221;</span></span></p>
<p>In the main add</p>
<p><span style="font-size: small;"> </span><span style="font-size: small;"> </span><span style="color: #5c2699;"><span style="font-size: small;">UIViewController</span></span><span style="font-size: small;"> </span><span style="font-size: small;">*vc = [[</span><span style="color: #3f6e74;"><span style="font-size: small;">GraphController</span></span><span style="font-size: small;"> </span><span style="font-size: small;"> </span><span style="color: #2e0d6e;"><span style="font-size: small;">alloc</span></span><span style="font-size: small;">] </span><span style="color: #2e0d6e;"><span style="font-size: small;">init</span></span><span style="font-size: small;">];</span></p>
<p>[vc <span style="color: #2e0d6e;"><span style="font-size: small;">setModalTransitionStyle</span></span><span style="font-size: small;">:</span><span style="color: #2e0d6e;"><span style="font-size: small;">UIModalTransitionStyleCrossDissolve</span></span><span style="font-size: small;">];<br />
 [</span><span style="color: #aa0d91;"><span style="font-size: small;">self</span></span><span style="font-size: small;"> </span><span style="font-size: small;"> </span><span style="color: #2e0d6e;"><span style="font-size: small;">presentModalViewController</span></span><span style="font-size: small;">:vc </span><span style="color: #2e0d6e;"><span style="font-size: small;">animated</span></span><span style="font-size: small;">:</span><span style="color: #aa0d91;"><span style="font-size: small;">YES</span></span><span style="font-size: small;">];<br />
 [vc </span><span style="color: #2e0d6e;"><span style="font-size: small;">release</span></span><span style="font-size: small;">];<br />
 </span><span style="color: #aa0d91;"><span style="font-size: small;">return</span></span><span style="font-size: small;">;</span></p>
<p><span style="font-size: small;"><br />
 </span></p>
<p><strong>And thats it!</strong></p>
<p>I have a sample xcode project available too.</p>
<table border="0" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td><a href="http://duivesteyn.net/wp-content/uploads/2010/03/TapkuGraphOnly.zip"><img title="Takpu GraphView Only xcode title icon" src="http://duivesteyn.net/wp-content/uploads/2010/03/Screen-shot-2010-03-08-at-10.39.11.png" alt="" width="300" height="128" /></a></td>
<td><a href="http://github.com/duivesteyn-enterprises/takpuGraphOnly"><img class="alignnone size-full wp-image-519" title="github" src="http://duivesteyn.net/wp-content/uploads/2010/03/github.png" alt="" width="120" height="60" /></a><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 13px; line-height: 19px;">￼</span></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://duivesteyn.net/2010/03/07/iphone-sdk-implementing-the-tapku-graph-in-your-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
