Quick chart_component example

Chart is an extension to the graphic component. By adding a parser as a plugin to the graphic module, you can add pie charts, bar charts, and line charts to your pdfs or images. The bar chart requires some fixes in the latest repository in svn.

includes.php:

$zoop->addComponent('chart');//automatically includes graphic

zone_default.php:

function pageTestChart($p)
{
	$gui = &new SmartPdf(1/* create a new pdf context */, 'wide'/* or tall */);
	$gui->addDivParser(new ChartParser());
	$gui->addParser(new ChartObjectParser());
	$gui->assign('data', array(
				1 => array(
					'color' => '#FF0000',
					'name' => 'Rent',
					'amount' => 1200,
					'spent' => 1200),
				2 => array(
					'color' => '#00FF00',
					'name' => 'Food',
					'amount' => 400,
					'spent' => 353.29),
				3 => array(
					'color' => '#0000FF',
					'name' => 'Utilities',
					'amount' => 200,
					'spent' => 239.22)
				));
	if(!isset($p[1]) || $p[1] == 'pie')
		$gui->display('budget/testChart.tpl');
	else
		$gui->display('budget/testBarChart.tpl');
}

testChart.tpl:

<div style="font-size: 14pt; text-align: center; font-weight: bold">Jan 2008</div>
<table>
	<tr>
		<td>
			<div style="font-size: 12pt; text-align: center; font-weight: bold">Budget</div>
			{* possible chart tags are piechart, horizontalbarchart, verticalbarchart, percenthorizontalbarchart, linechart(which is unstable) *}
			<piechart style="border: 0" depth="20"{* depth is for 3D *}>
				{foreach from=$data key="id" item="cat"}
					<chartdata text="{$cat.name}" value="{$cat.amount}" color="{$cat.color}" url="javascript: viewSummary('{$cat.name}', 'budgeted')"/>
				{/foreach}
				<div style="border: 0; text-align:center">
					<div width="250" style="border: 0;">
						<chartplot height="195"/>
					</div>
				</div>
				<div style="border: 0;text-align:center; height: 30">
					<chartstring text="Total Budget = %n" />
				</div>
				<div style="border: 0;text-align:center">
					<chartlegend/>
				</div>
			</piechart>
		</td>
		<td>
			<div style="font-size: 12pt; text-align: center; font-weight: bold">Budget</div>
			<piechart style="border: 0" depth="20">
				{foreach from=$data key="id" item="cat"}
					<chartdata text="{$cat.name}" value="{$cat.spent}" color="{$cat.color}" url="javascript: viewSummary('{$cat.name}', 'budgeted')"/>
				{/foreach}
				<div style="border: 0; text-align:center">
					<div width="250" style="border: 0;">
						<chartplot height="195"/>
					</div>
				</div>
				<div style="border: 0;text-align:center; height: 30">
					<chartstring text="Total Budget = %n" />
				</div>
				<div style="border: 0;text-align:center">
					<chartlegend/>
				</div>
			</piechart>
		</td>
	</tr>
</table>


testBarChart.tpl:
<div style="font-size: {cycle values="14pt,12pt,10pt"}; text-align: center; font-weight: bold">Budget and Expenses for Jan 2008</div>
{*grouping determines how each chart group is displayed. "side" means draw the bars side by side. "simple" means stack bars on top of one another*}
<verticalbarchart grouping="side" style="border: 0">
	{* each chart cat will be displayed side by side for each group of data *}
	<chartcat name="budgeted" text="Budgeted Funds" color="#0000FF"/>
	<chartcat name="expenses" text="Expenses" color="#FF0000"/>
	{foreach from=$data key="id" item="cat"}
		{* each group of data should have at least one data point for each category(but it is not required) *}
		<chartgroup name="{$cat.name}" text="{$cat.name}" color="{$cat.color}"/>
		{* each chartdata describes one bar *}
		<chartdata category="expenses" group="{$cat.name}" 
					value="{$cat.spent}" url="javascript: popup('expenses', 'taxes')"/>
		<chartdata category="budgeted" group="{$cat.name}" 
					value="{$cat.amount}" url="javascript: popup('budgeted', 'taxes')"/>
	{/foreach}
	<div style="border: 0;text-align:center">
		<div width="750" style="border: 0">
			<chartplot height="350" depthvector="0,0"/>
		</div>
	</div>
	<div style="height: 10"/>
	<div style="border: 0;text-align:center">
		<chartlegend/>
	</div>
	<div style="height: 10"/>
	<div style="font-size: 12pt; text-align: center; font-weight: bold">Printed {$smarty.now|date_format:"%A, %B %e, %Y"}</div>
</verticalbarchart>

AttachmentSize
budget-screenshot.png47.39 KB
budget-bar-screenshot.png21.6 KB

What is the DTD?

Is that syntax html, xml, svg? If not is there documentation or a DTD for it?

----------------------------------
Co-Author of Zoop Framework

steve.francia 27 Mar 2008

Syntax

The parser used is an xml parser, but most of the major html tags are implemented, so it is a subset of XHTML.

john 28 Mar 2008

This the way you just

This the way you just did.I'm really impressed that there's so much about this subject that's been uncovered and you did it so well, with so much class.Good one you, man! Really great stuff here
Custom Research Paper
Term Papers
Essay

Anonymous 02 Jun 2011

I wanted to thank you for

I wanted to thank you for this great read! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.
mayweather vs ortiz for the good of home ideas

zarahfulton 13 Jul 2011

I genuinely liked reading

I genuinely liked reading through your post!. Quality material. I might advise you to come up with blogposts even more often. By doing this, having this kind of a worthy website I think you will probably rank higher in the search engines.
pacquiao vs marquez | donaire vs narvaez | cotto vs margarito | pacquiao vs marquez streaming | donaire vs narvaez tickets | cotto vs margarito tickets | pacquiao vs marquez

zarahfulton 27 Sep 2011

Thanks!

well, good for you! I tell you! The things you can learn just by browsing the Internet! Content like what is found on this website is not easily found - and when it is, it needs to be recognized as such.
friv

sorindan 07 Dec 2011

Online Article…

[...]The information mentioned in the article are some of the best available [...]...

Los Verdes SOS | Signature DC | Aaryana

Mathew Norman | Carolina Slika Wiki | One Serious Threat

laticiamerow 21 Dec 2011

This site is describing

This site is describing about a popular food in Jerusalem. This very popular over Jerusalem. This post intriduce broadly about Passover. I want to share this with my friends.Computerhulp

leonardod 15 Jan 2012

I admit, I have not been on

I admit, I have not been on this webpage in a long time… however it was another joy to see It is such an seo reports for clients important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues.
Great stuff as usual…

vijaysbhagat 08 Dec 2011

After seeing this i made up

After seeing this i made up my mind that i am going to try one of this.I hope so it will pleasant and satisfying one.

Estudiar ingles en el extranjero

rael645 07 Nov 2011

The layout is what really

The layout is what really caught my eye, then the i looked at the writing and i think you did a very nice job. Good work

phlebotomist

kamalgandhi 15 Dec 2011

It is a echt article and

It is a echt article and inspires everyone to construct it completly. This is indeed rale gripping and pulling the readers. I revalue your thoughts.......
ediscovery software

multansz 18 Aug 2011

Looks good John

Appreciate John's blog and examples of code with the correct tags to implement the use of graphics. Since Zoop Framework is easier for novices to work with and implement. Quite PHP helpful, thanks! gatwick parking

SPerry2011 17 Oct 2011

I would also like to

I would also like to encourage everyone to bookmark this page to your favorite service to help spread the word. I will use this information to good effect! cell phone listening

lossietetias 02 Nov 2011

Austin Home Builder

If you can write the SQL to extract the data you want to plot, Plotalot will use the Google Charts API to produce line graphs, scatter graphs, bar charts, or pie charts, with numerous formatting options.Austin Home Builder

Lucky127 14 Jan 2012

What a coincidence

You know what a coincidence, my friend called me the other week asking me about using a chart plugin. Well I'm not the techy type so I shared this page instead. Let's see what he can say. Haven't seen his comment yet though.
gatwick hotel and parking | hotel and parking gatwick | car parking gatwick north terminal

SPerry2011 07 Nov 2011

I recently came across your

I recently came across your blog and have been reading along.I don't know what to say except that I have enjoyed reading. Thanks
flowers to Lebanon

bestadam 15 Dec 2011

This is good, explaining

This is good, explaining how's this chart program was done, what's behind this great tool. ultrasound technician schools

UltrasoundAdviser 21 Oct 2011

hi

Thanks, I was looking for information and your blog really helped me.
mould steel

Tool Steel 31 Oct 2011

Just what I needed I'm kinda

Just what I needed I'm kinda new with this so I really need all the help that I can get be yourself quotes.

Grets323 10 Nov 2011

I really thank you for the

I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best!

Panic Attacks Treatment

jazzbee 03 Dec 2011

gonllr

Wow, this was a really quality post. In theory I'd like to write like this too - taking time and real effort to make a good article... RGB LED Strip Light

xiaobu 07 Dec 2011

I found that site very

I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious... unlock iphone 4s

prince11 08 Dec 2011

This the way you just

This the way you just did.I'm really impressed that there's so much about this subject that's been uncovered and you did it so well, with so much class.Good one you, man! Really great stuff hereservices review

adam7962 21 Dec 2011

How to make Choley

How to make Choley Bhature:
• Mix maida, curd, oil and baking powder.
• Prepare smooth dough and keep it in a muslin cloth overnight.
• Grind ginger and garlic to make a paste.
• Heat the oil and fry onions till it turns brown.
• Add garam masala, red chilli powder, Cinnamon powder,
• ginger garlic paste & salt to it.
• Fry it well.
• Add soaked chana and water
• Cook it till it turns thick.
• Add pepper and mango powder.
• Cook it for five minutes.
• Chhole is ready.
• Roll out thick puris from the dough.
• Fry it till both the sides turns brown.
• Serve hot.
Chinese Delight

Ray Tango 26 Dec 2011

It is a echt article and

It is a echt article and inspires everyone to construct it completly. This is indeed rale gripping and pulling the readers. I revalue your thoughts....... Resume help

adam7962 29 Dec 2011

Wonderful illustrated

Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject! find hosting

superpower 01 Jan 2012

Thanks.

I am happy to find it. Thanks.
Scot

ScotWetherington 11 Jan 2012

Chart Love

I love any time that I can add charts and graphs to my post. Charts make everything easier to read and understand. I'm a visual person; I like to get all the information I need in one quick glance. It's much more efficient.

Anthony
remodeling reviews

nabo78 16 Feb 2011

This is just a small

This is just a small extension but its features are very helpful and easy to use. Like other Joomla! extensions, this plugin is easy to install, support for both joomla 1.5 and 1.6 version. JV Chart has a simple and friendly style fsa life settlements.

JerryS 01 Sep 2011

I always the appreciate the

I always the appreciate the work that is being presented in the charts and diagrams as the information is so easy to understand and to read. Really a fantastic presentation. tatuaggi

juliusrlevron 13 Sep 2011

i was stuck previously at

i was stuck previously at some point but now i got cleared out so thank you for the help. good-website

scott.allerdice 04 May 2011

Your blog is most likely the

Your blog is most likely the most influential blogs in this market. Almost every story you choose to create is golden. His skill with words is eloquent, exciting and interesting place.. Free Cell Phone Spy

hiradeen 01 Nov 2011

QuickChart

Graphs and Pie-Charts are very useful in understanding different situations.
More than the theory, they give better understanding.
Thanks for this wonderful post.
inhairit.com

johnhackman 02 Jun 2011

Auf Hausratversicherung-fbs

Auf Hausratversicherung-fbs vergleichen.

kammom 26 Jul 2011

nice post

I grew up in Newquay, on the Atlantic coast and there developed a love of the sea and boats.
it is very true in the boating industry, u can see boats for sale

I liked the banana-seat bikes with the high handlebars - maybe a card in the wheel could have been part of it. interesting bikes bikes for sale

Be grateful for luck. Pay the thunder no mind - listen to the birds. And don't hate nobody.
great post, birds and parrots relate to this birds for sale

bikes boats birds 08 Sep 2011

Such examples are quite good

Such examples are quite good enough for all of us to get a supportive material for our business issues. That is an outstanding posting. Keep sharing such material for all of us..
craigslist houston condos | classified portals article

iamasterss 07 Jun 2011

Hi there, Really nice

Hi there,
Really nice job,There are many people searching about that now they will find enough sources by your tips.
Also looking forward for more tips about that
Regards,
www.genericsmed.com

mattpowell 16 Jun 2011

Schufa

Sofortkredit und günstigen Kredit ohne Schufa beantragen. Wie es geht, erfahren Sie unter www.kredit-trotz-negativer-schufa.info.

Schufa 19 Jun 2011

This is really nice and

This is really nice and impressive. I am quite happy with such information. shingles symptoms

danny874 29 Jun 2011

you do good effort to solve

you do good effort to solve this problem of session looking.i think these tools are important and useful.thanks for info about these tool and these programs.
schildersbedrijf

casica 03 Jul 2011

very good site.

Do you mind if I quote a few of your articles as long as I provide credit and sources back to your site? My website is in the exact same niche as yours and my users would truly benefit from some of the information you present here. Please let me know if this ok with you. Cheers!
cure for pcod

bradleybenvenuti 07 Jul 2011

Wow, nice post, there are

Wow, nice post,
there are many person searching about that now they will find enough resources by your post
UP Noticias

harsh7 07 Jul 2011

Auf DSL-L.de

Auf DSL-L.de vergleichen.
Den DSL Test machen.

kammom 26 Jul 2011

I will be honest with you

I will be honest with you Zoop configuration could be a bit confusing.The Lunar branch now uses a cleaned up index.php to include components combined with a super-slick YAML-based config library.
kids clothing

daniel naveen 11 Jul 2011

Awesome and interesting article.

Awesome and interesting article. Great things you've always shared with us. Thanks. Just continue composing this kind of post.
Winter Games Online

jazzbee 08 Dec 2011

hmmm

the example is amazing and i never knew that we can generate such amazing data analysis results in this framework. hats off to the coder and i am totally learning from this!

Esportes EUA | Noivas Rio de Janeiro

khabmj 16 Jul 2011

This is what I was searching

This is what I was searching for so long. thanks a lot. car reviews

suchi889 19 Jul 2011

<a href="http://www.bellspharmacy.com"> Generic Viagra</a> ||

Wow, nice post,there are many person searching about that now they will find enough resources by your post

ricky1 20 Jul 2011

Eine

Eine Reiserücktrittsversicherung abschliessen
Wie die Reiseversicherung funktioniert.
Eine Krankenversicherung testen.

kammom 26 Jul 2011