Little Tricks on Download and Test Open Flash Chart
While finding a chart package for my project I noticed Open Flash Chart is very promising, so I decided to download it and try it out. Well, what’s good about Open Flash Chart? let’s see what the owner writes:
Open Flash Chart, is open source. It is free to use and you get the source code to fiddle with!
then How does it work?
- User browses to your web site.
- The browser downloads the web page which contains the Open Flash Chart.
- Open Flash Chart downloads the data file and displays the chart.
It sounds pretty easy, right? However, I had to spend quite sometime finding out the download link from Open Flash Chart’s homepage. I did try to click other links to see which one is going to take me to the download page, the page seems very sneaky though, and finally I clicked the one at the top right corner of the page which led me to the login page of sourceforge.net and I have to do a search from to get the very download page. I am sure some of you encountered the same issue as I did. Here I’d like to write down what I experienced so that my experience could benefit others.
First the homepage of Open Flash Chart is here, which actually is the documentation page. I guess you will have to stay there for a while to read and understand how Open Flash Chart works
[Update at 07-09-08]: http://www.teethgrinder.co.uk/open-flash-chart/download.php should work now!
The next thing you need to do is test it out before going further. I encounterd another problem here since I didn’t really follow the tutorial on creating the test page, I guess it’s my fault. Anyhow, here is what I encountered, I simply created “chart.php” and pasted the following code in the php assuming you put Open Flash Chart under your server’s root like Apache’s htdocs/open-flash-chart:
open_flash_chart_object( 500, 250, 'http://'. $_SERVER['SERVER_NAME'] .'/open-flash-chart/data-files/data-1.txt', false );
With this code only, your browser is totally blank, cuz flash really doesn’t like the HTML snippet generated by
open_flash_chart_object, because it doesn’t contain HTML tags. I had to spend sometime to figure this out, so the fix is to have the following:
open_flash_chart_object( 500, 250, 'http://'. $_SERVER['SERVER_NAME'] .'/
', false );
Now you should see either a chart or a flash with a message similar to the following:
If you don’t see anything, then you need to read the tutorial again to make sure you strictly follow it.
Note you may have to change above code to using either a single quote or double quote to follow PHP convention if the code doesn’t quite work