EFlot ajax example, anyone?

Hi there,

I would appreciate if somebody shows me an example on how to use the Eflot extension (Flot for Yii), but loading the data dinamically via Ajax.

I´ve been trying to adapt the ajax.html sample file (inside /assets/examples folder in the EFlot extension) to the EFlot widget use, but I still don´t know how.

Thanks in advance

Hi, I’d also like to know how to update a plot dinamically via Ajax.

I have something like this:


<?php

$this->widget('application.extensions.EFlot.EFlotGraphWidget', 

    array(

        'data'=>array(

            array(

                'label'=> 'line', 

                'data'=>array(

                    array(1,1),

                    array(2,7),

                    array(3,12),

                    array(4,32),

                    array(5,62),

                    array(6,89),

                ),

                'lines'=>array('show'=>true),

                'points'=>array('show'=>true),

            ),

            array(

                'label'=> 'bars', 

                'data'=>array(

                    array(1,12),

                    array(2,16),

                    array(3,89),

                    array(4,44),

                    array(5,38),

                ),

                'bars'=>array('show'=>true),

            ),

        ),

        'options'=>array(

                'legend'=>array(

                    'position'=>'nw',

                    'show'=>true,

                    'margin'=>10,

                    'backgroundOpacity'=> 0.5

                    ),

        ),

        'htmlOptions'=>array(

               'style'=>'width:400px;height:400px;'

        )

    )

);

?>






<?php

echo CHtml::ajaxSubmitButton(

	'Prova',

	array('reqFlot'),

	array(

		'update'=>'#<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/huh.gif' class='bbc_emoticon' alt='???' />?',

	)

);

?>

I don’t know how to handle the request.

Anyone?

Thanks