?

Log in

No account? Create an account
New web toy - Baxil [bakh-HEEL'], n. My Sites [Tomorrowlands] [The TTU Wiki] [Photos]
View My LJ [By Tag]


December 6th, 2007
03:46 pm
[User Picture]

[Link]

Previous Entry Share Next Entry
New web toy
Now you, too, can make up charts like this one* on the fly and embed them in your posts -- even if you don't have a website to host them on:



http://code.google.com/apis/chart/ has the details.

Fun contest in comments! Make up the most awesome fake chart! Winner gets official Baxil Points, redeemable for fine Baxil merchandise at fine Baxils everywhere!

--
* Venn diagram idea shamelessly reused from a floating Internet meme. I just needed something to test the API out with.

Current Location: ~spiral
Current Mood: amusedamused
Tags: , , ,

(15 comments | Leave a comment)

Comments
 
[User Picture]
From:baphnedia
Date:December 7th, 2007 02:09 am (UTC)
(Link)
Here goes nothing:

Special Note: I suck at APIs. So, when I suck at APIs, just grab what someone else did (that did the same thing I was going to do):
http://www.baldheretic.com/pics/humor/pacman.jpg
[User Picture]
From:baxil
Date:December 7th, 2007 10:40 am (UTC)
(Link)
Alright - lemme offer a quick tutorial how it works ... :)

We want to build a URL that will have all the data for the chart in it. Start by calling the program itself:
http://chart.apis.google.com/chart?

Define the size, more wide than tall so we have room for labels:
chs=450x150

Set the graph type to "pie chart":
cht=p

Set the colors to yellow and purple:
chco=ffff00,dd00dd

Add the top label:
chtt=Percentage+of+chart+which+resembles+Pac-Man

... and the labels for the data (pie charts, sadly, can't use chdl, just the pie-specific ones):
chl= Resembles+Pac-Man|Does+not+resemble+Pac-Man

And, finally, provide the data - we're just going to use text encoding and make the numbers roughly proportional to the original:
chd=t:80,20

... then string them all together with &s:

http://chart.apis.google.com/chart?chs=450x150&cht=p&chco=ffff00,dd00dd&chtt=Percentage+of+chart+which+resembles+Pac-Man&chl=Resembles+Pac-Man|Does+not+resemble+Pac-Man&chd=t:80,20

Voila, here it is! Just embed it in the post inside of an <IMG SRC> tag:



Edit: Fixed stray space in URL.

Edited at 2007-12-07 10:41 am (UTC)
[User Picture]
From:baxil
Date:December 7th, 2007 10:46 am (UTC)
(Link)
Addendum: There's no control over data orientation, but since it always starts at θ=0°, you can kinda fake it by splitting the "does not resemble" into two parts and shuffling the order.

http://chart.apis.google.com/chart?chs=450x150&cht=p&chco=dd00dd,ffff00,dd00dd&chtt=Percentage+of+chart+which+resembles+Pac-Man&chl=Does+not+resemble+Pac-Man|Resembles+Pac-Man&chd=t:12,80,12

[User Picture]
From:krinndnz
Date:December 7th, 2007 02:20 am (UTC)
(Link)
Eeeee! Venn Diagrams!

Can the API make Chernoff faces?
[User Picture]
From:baxil
Date:December 7th, 2007 10:51 am (UTC)
(Link)
You could probably get pretty close if you used a scatter plot with shape markers.

Extra credit to the first person who APIs up something resembling a face.
[User Picture]
From:solanth
Date:December 7th, 2007 03:46 am (UTC)
(Link)
Not "fake" per se, but still junk science. I hope it counts. :)

[User Picture]
From:baxil
Date:December 7th, 2007 10:52 am (UTC)
(Link)
Hee! :D
(Deleted comment)
[User Picture]
From:taral
Date:December 7th, 2007 03:48 am (UTC)
(Link)
Interesting. I wonder how small a data:image/svg URL would be for that?
(Deleted comment)
[User Picture]
From:baxil
Date:December 7th, 2007 10:52 am (UTC)
(Link)
So, so true.
(Deleted comment)
[User Picture]
From:packbat
Date:December 8th, 2007 02:17 am (UTC)
(Link)
I'll give this a shot...

Knowledge vs. Passion
[User Picture]
From:roaminrob
Date:December 9th, 2007 04:52 pm (UTC)
(Link)
That ... wow.

Good timing. I've been struggling with that very thing recently, that the more I learn about current events, and the world, and so on, the less energy I have for dealing with it in any meaningful way.
[User Picture]
From:packbat
Date:December 9th, 2007 05:30 pm (UTC)
(Link)
...huh. That's truer that what I drew, actually - I was alluding to people who have strong but completely uninformed beliefs. I guess it should look more like this:

Tomorrowlands Powered by LiveJournal.com