5 messages in com.googlegroups.google-chart-apiRe: Math equation parser/plotter
FromSent OnAttachments
Felipe Barone05 Jan 2008 12:20 
Uwe Maurer07 Jan 2008 01:03 
Felipe Barone10 Jan 2008 10:08 
Felipe Barone23 Jan 2008 06:45 
Uwe Maurer23 Jan 2008 08:49 
Subject:Re: Math equation parser/plotter
From:Felipe Barone (fgba@gmail.com)
Date:01/23/2008 06:45:54 AM
List:com.googlegroups.google-chart-api

Greetings Uwe,

i have made some changes on the script fixing: 1 - Rounded the values to get a shorter URL. 2 - Labels for axis are fixed. 3 - For some simple functions, the roots (e.g. F(x) = 0) are marked with a red circle.

I plan to implement some other functionalities like max and minimum for a functions and eventually, more than one function in same chart....

I still have an issue with points outside the chart range that sometimes totally screw the chart, for example try: fx: x*x*x+3*x*x-3 -4 >= x >= 3 -2 >= x >= 2

I have a couple ideas to fix this, but any suggestions are very welcome. I still didn't get to implement your suggestion to use cht=lc instead of cht=lxy, which indeed will make URL even shorter.

regards,

Felipe

On Jan 7, 7:03 am, Uwe Maurer <uwe.@google.com> wrote:

Hi Felipe,

thanks for doing this! It is very useful. I have some suggestions: - In the text encoding, instead of 13.3333333333,12.9363333333,12.5453333333,12.1603333333,11.7813333333,11.4083333333, you can use 13.3,12.9,12.5,12.1,11.7,11.4 This makes the URL much shorter and the chart image stays the same.

- For the labels you can use the chxr parameter (it does the labels automatically then). I think in your current version is a bug when the x range is eg -1 to 1, it gives -1, 1, 1 as labels, instead of -1, 0, 1 - Also if the space between the x values is always the same, it is better to use cht=lc instead of cht=lxy. Then you don't need to specify the x values.

Thanks, Uwe

On Jan 5, 9:21 pm, Felipe Barone <fgba@gmail.com> wrote:

I know some of you guys are working on this too, but here it is my first sample for plotting equation using google chart API:

this is a first draft and im using PHP to get the values and parsing into a valid GC url. For now it only takes simple functions (no trigonometrics, for example) and only one function at a time. Also im using text encoding data (http://code.google.com/apis/chart/#text) so if the range is too wide, it gets over 100 points and chart is plotted....

anyways, this is a draft as i said and any comments suggestions are very welcome! if anyone out there playing with PHP and CG let me know so we can exchange experiences and codes!

best regards,