All Posts in

Easy legend generation for the Google Charts API map chart type

April 04, 2008 | jeffreybarke

From: The Programming Mechanism

In an earlier post, I wrote "I agree with Bjørn that the lack of an API-generated legend is problematic, though one could be constructed via HTML adjacent to the chart." However, it turns out that creating a legend is a bit more difficult than I initially thought. The difficulty was brought to my attention via a post to the Google Charts API Google Group that requested help in writing a PHP function to determine the hex value of interpolated colors. Since I figured this would be a common problem, I wrote a PHP 4 class that will hopefully solve it. You can see the tmMapLegend class in action below with the map produced in the earlier tutorial. Learn more about the class and download it here: http://themechanism.com/barkode/code/tmmaplegend/.

Red States and Blue States, USA

  •   States carried by the Republicans in all four elections
  •   States carried by the Democrats in all four elections
  •   States carried by the Republicans in three of the four elections
  •   States carried by the Democrats in three of the four elections
  •   States carried by each party twice in the four elections

Jeffrey Barke is senior developer and information architect at theMechanism, a maxi-media firm in New York City and London.

Published by: jeffreybarke in The Programming Mechanism

theMechanism looks forward to Google I/O

April 04, 2008 | jeffreybarke

From: The Programming Mechanism

I'm totally stoked about my first trip to San Francisco for Google I/O, a two-day "developer gathering focused on pushing the boundaries of web applications using Google and open web technologies."

Today is the last day of early bird registration, so if you're going to go, register quick and save a hundred bucks.

I'll definitely be writing more about this as the date approaches…

Jeffrey Barke is senior developer and information architect at theMechanism, a maxi-media firm in New York City and London.

Published by: jeffreybarke in The Programming Mechanism

About The Mechanism

The Mechanism was founded in 2001 on the principle that success in new and traditional media would demand tighter connections between multiple customer messaging channels. We strongly believe that a good team is one that collaborates face-to-face and in person, which is why we avoid outsourced development. Our mission is to help our clients communicate with their target markets effectively and seamlessly across all channels and media types. We do this by using time-tested skills, processes, tools and techniques to deliver rich user experiences and solid technology platforms.

Twitter | Facebook | Instagram | LinkedIn

© 2001-2015 The Mechanism