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 to dynamically create a hard-coded javascript array) On May 18, 6:10 pm, Céryl <[email protected]> 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 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, yaxis] > [xaxis, yaxis]]; > > and then calls the plot graph function in FLOT to build it. These > functions (With the array currently hardcoded) are in my project in a > seperate .js file I load in my view. > > However, When I get into my controller and get the relevant data, and > pass it to the view using Cake's Set, how can I get that (PHP)array > converted and passed to the javascript (.js file) that builds the > graph? > > Has anybody any expierience or idea's with this? And if there are > graphing libraries that allow for on-the-fly graphs from a database, > that work better with Cake, please tell me! Now it's not to late to > switch! > > Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
