Creating fancy maps and pie charts using google api charts
Download
1 / 13

repec - PowerPoint PPT Presentation


  • 375 Views
  • Updated On :

Centre for Employment Research Creating fancy maps and pie charts using Google API charts Lionel Page and Franz Buscha Introduction These ado files use Stata’s ability to easily interface with the internet and contact: chart.apis.google.com

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'repec' - salena


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Creating fancy maps and pie charts using google api charts l.jpg

Centre for Employment

Research

Creating fancy maps and pie charts using Google API charts

Lionel Page and Franz Buscha


Introduction l.jpg
Introduction

  • These ado files use Stata’s ability to easily interface with the internet and contact:

    chart.apis.google.com

  • Google chart API (Application Programming Interface) allows users to dynamically create charts and maps by sending a pre-programmed URL to Google

  • Google then returns a PNG-image which, with a bit of luck, is a useable piece of information!


Google charts api l.jpg
Google charts API

  • Stata’s unique and powerful data-management abilities make it a good complement in order to pre-format data and then send it to Google and allow it to compile this data into a different array of graphs/figures.

  • How does Google API work?

    http://chart.apis.google.com/chart?chs=250x100 [size]&chd=t:60,40 [data]&cht=p3 [type]&chl=Hello|World[labels]


Slide5 l.jpg
GMAP

  • Here we present gmap which allows users to create .png using Google API chart

    In its current state (v1.1) gmap accepts the following command line:

    gmaplocation statevarvaluevar{if} [, color(# [#]) graph file(filename)] Width(numlist) Height(numlist)]

    The parameter location can take the following values: africa, asia, europe, middle_east, south_america, usa, world. For each specific region, statevar must contain the States' identifiers from the list of codes from Google.



Example of gmap7 l.jpg
Example of GMAP

  • The following picture will be saved in your local directory

    gmapusa states value, color(yellow green) graph h(100) w(200)



Considerations l.jpg
Considerations

  • Only have 1 colour gradient at the moment

    • Different shades of one colour

    • Transition from one colour to another

  • Google allows multiple gradients

    • I.e, from green to black to red

  • This ‘should’ allow specific colours across regions

    • E.g. Cons/Labour/Libdems (Blue, Red, Yellow)

  • v.1.2


Slide10 l.jpg
GPIE

  • Here we present gpiewhich allows users to create 3 dimensional pie charts

    In its current state (v1.0) gpieaccepts the following command line:

    gpielabelvarvaluevar {if} [, color(#) dim2 graph file(filename)]



Example of gpie12 l.jpg
Example of GPIE

  • The following picture will be saved in your local directory:.

    Alternatively,

    gpie label values, color(yellow) dim2


Useage and limitations l.jpg
Useage and Limitations

  • Google API charts is aimed at web-based developments such as blogs and websites and therefore offers little in terms statistical analysis

  • gmap should be seen as a informational and explorative tool

  • Limited to 250,000 API calls per day

  • No labels!

  • Maximum picture size is 440x220 pixels

  • Country labels must be in ISO 3166-1-alpha-2 code

  • Only United States supports state level mapping

  • Please findittmap(Pisati, 2004, SJ) for more complicated thematic mapping futures using Stata’s graphics engine


ad