Tuesday, June 30, 2009

Re: I cannot render a chart using Open Flash Chart Helper

it´s the helper from http://svn2.assembla.com/svn/cakeopenflashchart/trunk/flash_chart.php
??
I think the problem is in this line: echo $flashChart->chart();
there is no chart function in the helper.
you have another problem in this line: echo $flashChart->begin();
you should not do an echo here because begin() function returns void.
try this:
<?php
$flashChart->begin(400, 250);
$flashChart->title('Example 4 - Pie Chart: My imaginary Browser
Stats');
$browser_data = array(
'Firefox' => array(
'value' => 30
),
'Opera' => array(
'value' => 7
),
'IE' => array(
'value' => 38
),
'Other' => array(
'value' => 25
)
);
$flashChart->pie($browser_data);
echo $flashChart->render();
?>

On 30 jun, 18:05, Frannie <demoniob...@gmail.com> wrote:
> Hello to everyone,
> I want to use  Flash Chart Helper to show some charts in my
> application.
> I downloaded all necessary files and located them into the following
> places:
>
> /app/views/helpers/flash_chart.php
> /app/views/helpers/flash.php
> /app/vendors/flashchart/open-flash-chart.php
> /app/vendors/flashchart/*37 other files at the time of this writing*
> /app/webroot/flash/open-flash-chart.swf
> /app/webroot/js/swfobject.js
> /app/webroot/js/json/json2.js
>
> I also added this line to my controller:
>
> var $helpers = array('Html', 'Form','FlashChart');
>
> and placed this example into my view
>
> <?php
>          echo $flashChart->begin();
>          $flashChart->setData(array(1,2,4,8));
>          echo $flashChart->chart();
>          echo $flashChart->render();
>      ?>
>
> <table>
> <tr><td>1</td><td>one</td></tr>
> <tr><td>1</td><td>two</td></tr>
> <tr><td>1</td><td>three</td></tr>
> <tr><td>1</td><td>four</td></tr>
> </table>
>
> but when I try to load it, the chart doesn't show.... I can only see
> the table...
> If somebody knows what is going please tell me
> I've tried several other examples (none of them seem to work)
> Thank you in advance.
>
> Francisca.
> PS: Please if you have any questions let me know, english is not my
> first language so I could have missed something in this message

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: