Bespoke App development for the Web and Devices

Math parser charting example


11.29.07 Posted in Actionscript, Flex Development by admin

I stumbled across an excellent website called Flash&Math the other day that contains several useful Actionscript 3 and Flash CS3 tutorials.  The MathParser class, developed by Doug Ensley and Barbara Kaskosz , is used in their ‘Simple Function Grapher‘ tutorial and I decided to try it out in Flex 3 with a line chart component.

 The Parser works really well and is nice to work with.  The instance.errorStatus and instance.errorMes properties are potentially very useful by helping to validate the equation strings entered in input fields, something that isn’t present in other parsers that I’ve come across. (I’m not using it in this simple example though). 

I’ve developed a few different interactive Maths activities in the last couple years, writing charts and grids from scratch, so I can really appreciate how the Flex Charting components can simplify development.  Here’s a line chart that shows the resulting graphs for different equations (created with only a few lines of code!).

Post to Twitter



Comments are closed.