Charts and graphs with jplot, jQuery and php

For rendering charts in one of my projects, I started using jplot library.

Usage is pretty simple, but I needed some specifics in implementation.
First, add the following lines to HEAD section:

In my case, I used also date rendering and some more features, provided by jplot.

Then I added the following code to my page:

I used such construction in order to dynamically return reports on needed options.

My javascript code is following:

To display correctly all these data, we need correct data to be returned by our php script. In my case it should be in format of JSON data [[‘2008-09-30 4:00PM’,4], [‘2008-10-30 4:00PM’,6.5], [‘2008-11-30 4:00PM’,5.7], [‘2008-12-30 4:00PM’,9], [‘2009-01-30 4:00PM’,8.2]]

For this purpose, I generate output of script in the following way: