Click here to Skip to main content
15,881,687 members
Articles / API
Tip/Trick

Google Charting API and Formula Imaging

Rate me:
Please Sign up or sign in to vote.
4.94/5 (8 votes)
3 Oct 2011CPOL 31K   11   4
Use Google APIs to create Graphical Formulas

Update: 3rd Oct, the link to the chart playground should now work after Google appeared to have moved things around, if it breaks again, just visit code.google.com, and go to the charting section.

Recently I wrote an article and it used some formula, and had the formula shown in text format which ends up with the likes of the following;

 

α = 2Atan( H1 / ( √(((2H1D)/2)-H12)))

 


I am sure you would agree that it doesn't look very pretty. I wanted to turn this into something more presentable.

In the end, I came across Google Chart Tools / Image Tools here[^], which use the TeX notation for building graphical representations on formula.

A little more hunting and I found a useful cheat sheet for TeX Notation here[^]

Putting things together, you can then save the outputed image for your local use. Here is the example from the above in text linked directly to the Google API:

 

 


The API construct for this is:

 

 

cht=tx
chl=\alpha=2Atan{\HUGE[}\frac{H_{1}}{\sqrt((\frac{2H_{1}D}{2})-H_{1}^2)}{\HUGE]}

 


For more information, click here[^] to take you to this API page with this example already loaded.

 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
Scotland Scotland
I have been working in the Oil & Gas Industry for over 30 years now.

Core Discipline is Instrumentation and Control Systems.

Completed Bsc Honours Degree (B29 in Computing) with the Open University in 2012.

Currently, Offshore Installation Manager in the Al Shaheen oil field, which is located off the coast of Qatar. Prior to this, 25 years of North Sea Oil & Gas experience.

Comments and Discussions

 
GeneralReason for my vote of 5 Cool :-) Pin
raja_krish8-Jun-11 6:05
raja_krish8-Jun-11 6:05 
GeneralReason for my vote of 5 Very useful. Pin
Lokanta_b25-Jan-11 4:30
Lokanta_b25-Jan-11 4:30 
GeneralReason for my vote of 5 Great simple summary of a service I ... Pin
Phil Martin23-Jan-11 12:45
professionalPhil Martin23-Jan-11 12:45 
GeneralRe: I recently started poking around http://code.google.com, sur... Pin
DaveAuld23-Jan-11 19:12
professionalDaveAuld23-Jan-11 19:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.