Hi Céryl,
This was very useful for me as I'm trying to use flot as well.
I did something similar by first trying to build up an array of tuples
and then used the $javascript-object() function which produces a JSON
array which is perfect input for flot e.g.
foreach($data as $key = $val){
Hej all!
I've been trying to find a solution for this, and maybe I'm
approaching it wrong. This is the case:
For my site I need make graphs out of data in a table. I have picked
JQuery FLOT for making the graphs. However, FLOT needs data in a
jQuery array build like:
[[xaxis, yaxis]
[xaxis,
Hi,
Try looking at JavascriptHelper::object()
http://api.cakephp.org/class/javascript-helper#method-JavascriptHelperobject
It will help you render a javascript object of any data you have in
php.
...or just parse out your data to a string yourself and set it as a
javascript variable. (= use php
You could use the JavascriptHelper to create the array, or any other
block of JS code.
On Mon, May 18, 2009 at 12:10 PM, Céryl c.a.h.wilt...@student.tue.nl wrote:
Hej all!
I've been trying to find a solution for this, and maybe I'm
approaching it wrong. This is the case:
For my site I
Worked almost a charm... Still, I ended up writing a this codeblock to
manually make-up the output the way I want it:
$i=0;
$output = [;
foreach($data as $key=$val){
if ($i != 0) {$output .= , ;}
$output .= [.$key., .$val.];
$i++;
}
$output .= ];
echo $output;
It makes