(stOfcPlugin) New plug-in to create flash charts

Ask help about existing plugins, or find advice about the way to build up your own.

(stOfcPlugin) New plug-in to create flash charts

Postby drashid » Mon Apr 20, 2009 2:46 pm

Hi,

I had been looking a plug-in to create charts for my websites but I did not found what I was looking for. :cry:

So, I decided to create a plug-in. And finally I have uploaded stOfcPlugin to create flash charts based on an array of data.

Image

With the help of stOfcPlugin you can create,

    Bar Chart
    Line Chart
    3D Bar Chart
    Area Chart
    and more...
For more details rendez-vous sur:

http://www.symfony-project.org/plugins/stOfcPlugin

Current stable version is 1.0.1 for symfony 1.1 and 1.2 while I am working to enhance the features e.g. using widgets to create charts (thanks to Frederic).

I would love to have feedback or comments and if you have any question/problem, don’t hesitate to ask.

You can find my email address at the home page of the plug-in or you can post a reply.

Thanks. :)~ :-)~ :smile:
Last edited by drashid on Tue Sep 14, 2010 12:36 pm, edited 2 times in total.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby pspalves » Wed Apr 22, 2009 5:36 pm

Hi Drashid!

I'm testing your plugin but I only got this error:

Warning: include_once() [function.include]: Failed opening '' for inclusion (include_path='/usr/share/php/symfony/plugins/sfPropelPlugin /lib/vendor:/var/www/cchart:.:/usr/share/php:/usr/share/pear :/usr/share/php/symfony/plugins/sfPropelPlugin/lib/creole/da tabase/../../vendor:/usr/share/php/symfony/plugins/sfPropelP lugin/lib/propel/database/../../../lib/vendor/') in /var/www/cchart/plugins/stOfcPlugin/lib/stOfc.class.php on line 16

then:

Fatal error: Call to undefined function _ofc() in /var/www/cchart/plugins/stOfcPlugin/lib/stOfc.class.php on line 58

the project is new, without others plugins or actions or templates. But your example module can't run. Can you help me? If you need more info please tell me.

thanks in advance
pspalves
Junior Member
 
Posts: 4
Joined: Wed Apr 22, 2009 5:27 pm
Location: Brazil

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Wed Apr 22, 2009 6:02 pm

Ohhh... :shock:

Can you please tell me the version of symfony you are using?
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby pspalves » Wed Apr 22, 2009 6:40 pm

version 1.1.5
pspalves
Junior Member
 
Posts: 4
Joined: Wed Apr 22, 2009 5:27 pm
Location: Brazil

Re: (stOfcPlugin) New plug-in to create flash charts

Postby pspalves » Wed Apr 22, 2009 7:50 pm

well, for now the problem was temp fixed using the following lines:

starting from line 16 stOfc.class.php
Code: Select all
//include_once sfConfig::get('st_ofc_object');
include_once ('ofc/open_flash_chart_object.php');
include_once ('ofc/open-flash-chart.php');


hope this help you to do the fix (and not this "work around" :P)
pspalves
Junior Member
 
Posts: 4
Joined: Wed Apr 22, 2009 5:27 pm
Location: Brazil

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Wed Apr 22, 2009 8:58 pm

That’s exactly where the problem was. Thanks for pointing it out. It will be fixed in the next release. :)~ :-)~ :smile:
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby pspalves » Fri Apr 24, 2009 3:02 pm

Thanks for the plugin!
My poc is running ok now!

Well done! Keep the good work!
pspalves
Junior Member
 
Posts: 4
Joined: Wed Apr 22, 2009 5:27 pm
Location: Brazil

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Fri Apr 24, 2009 3:59 pm

Thanks for the comments. There is a lot of work to do and it is really nice to have comments. :)~ :-)~ :smile:

Today I have added a ticketing URL to plug-in to report bugs. There is another bug reported :roll: so, I will try to fix all and commit to repository SVN (coming weekend).
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Sun May 10, 2009 1:21 am

I got a mail asking that,

I have a quetion about javascript : does the plugin supports JavaScript integration?
I' would like to call some actions when the user clicks on a chart, is it possible?


So, I decided to add the answer and solution to the post and no doubt I will update the documentation in the new release :)~ :-)~ :smile:

The anwser is YES and following are the solutions for Pie Chart, Bar Chart and Line Chart,

First of all please visit the following link to read and compare with actual functions:
http://www.symfony-project.org/plugins/stOfcPlugin/1_0_1?tab =plugin_readme

Pie Chart

Code: Select all
$chatData = array();
//Add and array for JavaScript
$scripts = array();

for( $i = 0; $i < 7; $i++ )
{
   $value = rand(5,20);
   $data[] = $value;
   //add JavaScript to be executed on click
   $scripts[] = "javascript:alert('$value')";
}

//Add JavaScript to chart with values
$g->pie_values($data, array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'), $scripts);


Bar Chart

Code: Select all
$chartData = array();
   
//To create a bar chart we need to create a stBarOutline Object
$bar = new stBarOutline( 80, '#78B9EC', '#3495FE' );
$bar->key( 'Number of downloads per day', 10 );

//Array with sample random data
for( $i = 0; $i < 7; $i++ )
{
  $value = rand(1,20);
  //In this example this is needed just to get the max value for y-axis
  $chartData[] = $value;
  //add JavaScript
  $bar->add_link($value, "javascript:alert('stOfcPlugin: Value : $value')" );
}

Comment or remove the following line
Code: Select all
//Passing the random data to bar chart
//$bar->data = $chartData;


Line Chart
Code: Select all
//create new line using
$chartData = new stLine( 2, '#3495FE' );
$chartData->key( 'Number of downloads per day', 10 );
   
//$chartData = array();
for( $i = 0; $i < 7; $i++ )
{
  $value = rand(0, 50);
  //add javascript for each value
  $chartData->add_link( $value, 'javascript:alert("Total number of downloads = '. $value .'" ;)' );
}

Comment or remove the following Line of code
Code: Select all
//Use line_dot to set line dots diameter, text, color etc.
//$g->line_dot(2, 3, '#3495FE', 'Number of downloads per day', 10);

Replace:
Code: Select all
//$g->set_data( $chartData );

With
Code: Select all
$g->data_sets[] = $chartData;


I hope this will be helpful.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby symf » Mon May 18, 2009 8:22 pm

when I try to create a chart (Bar Chart ) I get the following output:

Strict Standards: Non-static method graph::esc() should not be called statically, assuming $this from incompatible context in /srv/www/symfony/test/plugins/stOfcPlugin/lib/ofc/open-flash -chart.php on line 1415 &title=stOfcPlugin+example,{font-size: 20px;}& &x_label_style=10,#18A6FF,0,2& &x_axis_steps=2& &y_legend=stOfcPlugin,12,#18A6FF& &y_ticks=5,10,4& &x_labels=Monday,Tuesday,Wednesday,Thursday,Friday,Satur day,Sunday& &y_min=0& &y_max=16& &bg_colour=#E4F5FC& &x_axis_colour=#8499A4& &x_grid_colour=#E4F5FC& &y_axis_colour=#8499A4& &y_grid_colour=#E4F5FC& &inner_background=#E3F0FD,#CBD7E6,90& &filled_bar=80,#78B9EC,#3495FE,Number+of+downloads+per+d ay,10& &values=3,12,2,2,1,9,16&


I use symfony 1.27. I do everything like it's described by Readme.
symf
Junior Member
 
Posts: 27
Joined: Wed May 06, 2009 7:30 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Mon May 18, 2009 10:55 pm

Ooopss… :?~ :-?~ :???:


It seems that you are calling the method which is used to process chart data. So, the output is normal.

For example in case of bar chart you need to add following line of code in your template (say indexSuccess.php).

Code: Select all
<?php stOfc::createChart( 500, 250, 'stOfcExample/barChartData', false ); ?>


Here we should not call the method executeBarChartData() e.g.

(http://localhost/stOfcPlugin/web/frontend_dev.php/stOfcExamp le/barChartData)

to display the chart as this method is only required to process the data.


So, what should be done to display the chart and what URL to be called? :?~ :-?~ :???:

Don't worry it's very simple.
:)~ :-)~ :smile: Assuming the template is indexSuccess.php we should add a method in actions.class.php for our template i.e. “executeIndex()” in this case,

Code: Select all
public function executeIndex(sfWebRequest $request)
{
//Your code here
}


And call this method in URL
http://localhost/stOfcPlugin/web/application.php/moduleName/ index
Or
http://localhost/stOfcPlugin/web/application.php/moduleName

In case of example module provided with plugin the URL for localhost to display chart will be
http://localhost/stOfcPlugin/web/frontend_dev.php/stOfcExamp le

To test stOfcPlugin, don’t forget to enable the stOfcExample module in your `settings.yml``file. For details about how to enable stOfcExample module, visit:
http://www.symfony-project.org/plugins/stOfcPlugin/1_0_1?tab =plugin_readme

For further details please have a look at the stOfcExample module provided with plugin.

Please, don’t hesitate if you have any question.

Comments, feedback and suggestions are welcome. :)~ :-)~ :smile:
Last edited by drashid on Tue Jun 09, 2009 9:42 am, edited 1 time in total.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby symf » Tue May 19, 2009 7:03 pm

@drashid

Thank you very much. :)~ :-)~ :smile: Your tips helped me. It works now :D~ :-D~ :grin:
Maybe I was awkward with the execution of the readme instructions but your explanation was helpful for me. Thank you! :o~ :-o~ :eek:

Only one thing was confusing:




If I call this method I get a HTTP/1.x 500 Internal Server Error
.
You should call http://localhost/application/module/action whereas you should regard to implement the methods which you described above.
Last edited by symf on Tue May 19, 2009 7:21 pm, edited 1 time in total.
symf
Junior Member
 
Posts: 27
Joined: Wed May 06, 2009 7:30 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby symf » Tue May 19, 2009 9:25 pm

I'm sorry to ask again but I have another problem which I cannot solve. When I want to create a ofc-diagram in an new project everything is ok. However I want to create ofc-diagrams within an existing project - an there is my problem.
When I call
http://localhost:87/frontend_dev.php/stOfcExample
I get this result:
<img src="http://img141.imageshack.us/img141/5461/stofcplugin.jpg" border=0 alt="http://img141.imageshack.us/img141/5461/stofcplugin.jpg">

(Refreshing of the site is also pointless.)
Why I don't get my diagrams but this images? Should I pay regard to something?
Anybody know the cause???
symf
Junior Member
 
Posts: 27
Joined: Wed May 06, 2009 7:30 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Tue May 19, 2009 10:48 pm

This indicates that the Chart is unable to load data :(~ :-(~ :sad: i.e. the URL of data provided to createChart() is not working.

Try to call the URL of data in your browser and verify that whether you got the output same as you mentioned in your last post.
Last edited by drashid on Wed May 20, 2009 9:35 am, edited 1 time in total.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby symf » Mon May 25, 2009 7:34 pm

I think I know the cause of my error.
My apache was configured on port 89. The answer to this problem was to change the port to 81. :D~ :-D~ :grin:
Last edited by symf on Mon May 25, 2009 7:36 pm, edited 1 time in total.
symf
Junior Member
 
Posts: 27
Joined: Wed May 06, 2009 7:30 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby HiDDeN » Mon Jun 08, 2009 5:40 pm

Would it be possible to add the Stacked Bars Chart?
HiDDeN
Senior Member
 
Posts: 161
Joined: Wed Jul 26, 2006 6:34 pm
Location: Barcelona, Spain

Re: (stOfcPlugin) New plug-in to create flash charts

Postby Lucas0721 » Mon Jun 08, 2009 10:31 pm

well...I have the same problem when i call in my browser

http://localhost/project/web/aplicacion/stOfcExample/lineCha rtData

Get the folowing Result:

&title=stOfcPlugin+example,{font-size: 20px;}& &x_label_style=10,#18A6FF,0,1& &x_axis_steps=1& &y_ticks=5,10,5& &line_dot=2,#3495FE,Number of downloads per day,10,3& &values=14,1,0,28,49,24,43& &x_labels=Mon,Tue,Wed,Thu,Fri,Sat,Sun& &y_min=0& &y_max=49& &bg_colour=#E4F5FC& &x_axis_colour=#8499A4& &x_grid_colour=#E4F5FC& &y_axis_colour=#8499A4& &y_grid_colour=#E4F5FC& &inner_background=#E3F0FD,#CBD7E6,90&&title=stOf cPlugin+example,{font-size: 20px;}& &x_label_style=10,#18A6FF,0,1& &x_axis_steps=1& &y_ticks=5,10,5& &line_dot=2,#3495FE,Number of downloads per day,10,3& &values=14,1,0,28,49,24,43& &x_labels=Mon,Tue,Wed,Thu,Fri,Sat,Sun& &y_min=0& &y_max=49& &bg_colour=#E4F5FC& &x_axis_colour=#8499A4& &x_grid_colour=#E4F5FC& &y_axis_colour=#8499A4& &y_grid_colour=#E4F5FC& &inner_background=#E3F0FD,#CBD7E6,90&


thank for your help
Lucas0721
Junior Member
 
Posts: 9
Joined: Fri Feb 27, 2009 7:02 am
Location: Cucuta

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Tue Jun 09, 2009 10:08 am

@HiDDeN
Unfortunately this feature is not available in the current release of stOfcPlugin. But I can assure you that “Stacked Bars Charts” will be the part of stOfcPlugin in near future. So, stay tuned...

@Lucas0721

It is mentioned earlier in “message #78642” that this is not a bug and the output is normal because you are calling the method which processes the data. Calling this URL can be helpful if you want to dump your data while debugging.

To create/view the chart you have to call the method to render your template which calls createChart() (e.g. index).

In case of stOfcExample the URL can be:
Code: Select all
http://localhost/project/web/aplicacion/stOfcExample

or
Code: Select all
http://localhost/project/web/aplicacion/stOfcExample/index

Please read (above) my reply i.e. “message #78642” for more details.

http://forum.symfony-project.org/index.php?t=rview&goto= 78642%20#msg_78642

Please don't hesitate if you still have the problem or if you have another question :)~ :-)~ :smile:
Last edited by drashid on Tue Jun 09, 2009 12:19 pm, edited 1 time in total.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby Lucas0721 » Tue Jun 09, 2009 3:53 pm

thans for your help.


well i do all... but the only that I can See is the screen with four while frame.

My template is:

<?php stOfc::createChart( 500, 250, 'stOfcExample/pieChartData', false ); ?>
<?php stOfc::createChart( 500, 250, 'stOfcExample/barChartData', false ); ?>
<br /><br />
<?php stOfc::createChart( 500, 200, 'stOfcExample/lineChartData', false ); ?>
<?php stOfc::createChart( 500, 250, 'stOfcExample/3DBarChartData', false ); ?>


But yet...Not Shown me the Grapics
Thanks for your help ..I am new in Symfony
Attachments
Dibujo.jpg
Dibujo.jpg (79.79 KiB) Viewed 4741 times
Last edited by Lucas0721 on Tue Jun 09, 2009 3:55 pm, edited 1 time in total.
Lucas0721
Junior Member
 
Posts: 9
Joined: Fri Feb 27, 2009 7:02 am
Location: Cucuta

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Wed Jun 10, 2009 4:35 pm

I have tested the plugin and it works nicely with Opera.

So where the problem is :?:

Screenshot with blank frames and a message "Clic para activar y usar este control" (Click to activate and use this control) indicates that browser has the flash object's info but failed to find the flash animation ".swf" i.e. "open-flash-chart.swf".

So, verify that you have stOfcPlugin directory in web directory (containing images and js directories). I.e.
Code: Select all
project\web\stOfcPlugin\images\
project\web\stOfcPlugin\js\

And also that you have “open-flash-chart.swf” in the images directory i.e.
Code: Select all
project\web\stOfcPlugin\images\open-flash-chart.swf

If this resolves the problem then I would like to know the way you have used to add stOfcPlugin to your project.

Whether you have installed plugin using,
Code: Select all
$ symfony plugin:install stOfcPlugin

Or you have downloaded the plugin and added it to your project manually.
Last edited by drashid on Wed Jun 10, 2009 5:37 pm, edited 1 time in total.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby dexterRSA » Fri Aug 07, 2009 2:27 pm

Hi

I have sfOfcPlugin working but now I want to send an array with data to the function. How do I call the action in the template then?

For example:

I want to send $data, a variable in the template to the createChart action. How do I do this?

Code: Select all
 
<?php stOfc::createChart(1000, 500, 'chart/LineChartData?data='.$data, false); ?>


Thanks
dexterRSA
Junior Member
 
Posts: 2
Joined: Fri Aug 07, 2009 2:24 pm
Location: Stellenbosch

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Fri Aug 07, 2009 10:19 pm

Hi,

You need pass your array just as you have mentioned. :)~ :-)~ :smile:

In your action you can retrieve your array by using standard symfony way. ;)~ ;-)~ :wink:

As your data is in array format so, don’t forget to serialize your data before passing to URL.

Code: Select all
<?php
$data = serialize($data);
stOfc::createChart(1000, 500, 'chart/LineChartData?data='.$data, false);
?>

Code: Select all
public function executeLineChartData(sfWebRequest $request)
{
  $data = $request->getParameter('data');
  $newData = unserialize($data);
  ...
}


:idea: For testing you can also call the method lineChartData with required parameters (data), directly in your browser.

Don’t hesitate to ask if you still have any question.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts [solved]

Postby dexterRSA » Tue Aug 11, 2009 2:46 pm

Hi

My problem is solved now.
I did not unserialze the data that I serialized correctly :)~ :-)~ :smile:

Thanks for the help.
dexterRSA
Junior Member
 
Posts: 2
Joined: Fri Aug 07, 2009 2:24 pm
Location: Stellenbosch

Re: (stOfcPlugin) New plug-in to create flash charts [solved]

Postby Sanjuro » Thu Aug 20, 2009 11:37 am

Hi, can stOfcPlugin handle multi-dimensional arrays

like:
Array
(
[data] => Array
(
[glob200905] => 4
)

[labels] => Array
(
[0] => glob200905
)

[title] => Sales Per Group
)

Where each array value would replace certain variables in the chart?

I also would like to know if it would be possible to create a myChart ( in lib folder )class that creates myChart objects, the class would then have functions to generate the different charts using stOfcPlugin after passing them certain arguments.

This way one could call an action from a form that would collect and pass argumets to a myChart Object which would then generate the chrat ?
Sanjuro
Member
 
Posts: 34
Joined: Sun Jun 29, 2008 3:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts [solved]

Postby drashid » Mon Aug 24, 2009 9:45 am

You can create a class (e.g. myChart) in lib folder to set different parameters for different types of charts by calling it from action.

For multi-dimensional arrays can you provide more details? In your example I am unable to understand the purpose of using multi-dimensional array. Or you can simply use your array to set different parameters.
Code: Select all
//In case of bar chart
$yourbarChart->data = $yourArray['data'];

$yourChart->title( $yourArray['title'], '{font-size: 20px;}' );

$yourChart->set_x_labels($yourArray['labels']);

You are free to download the plug-in and do some exploring/testing. You might find what you are looking for.

Feel free to post what you will explore or if you have any question.
Last edited by drashid on Mon Aug 24, 2009 3:31 pm, edited 1 time in total.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts [solved]

Postby Sanjuro » Mon Aug 24, 2009 3:37 pm

Hi, I sorted out the Multi Dimensional Array issue.

Could you give me an example class. I tried writing my own class, but upon rendering it just sends back text, though I can see the data is being contained in the class I wrote.
Sanjuro
Member
 
Posts: 34
Joined: Sun Jun 29, 2008 3:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby mila_1881 » Thu Nov 05, 2009 10:35 am

hi!!
first thxx for the plugin!!

everything is working properly but when there is a lot of data the .swf is still loading so what is the issue???
mila_1881
Member
 
Posts: 35
Joined: Fri Nov 28, 2008 12:11 pm
Location: tunisia

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Fri Nov 06, 2009 11:33 am

As you said that everything works nicely in normal cases, on the other hand I have done some and found no problem. So, it would be helpful if you can attach sample data and if possible the method you are using to create chart.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby ankalagon » Mon Nov 30, 2009 8:31 pm

Great plugin! Very usefull

8-)
ankalagon
Junior Member
 
Posts: 18
Joined: Tue Sep 22, 2009 6:42 pm
Location: Spain

Re: (stOfcPlugin) New plug-in to create flash charts

Postby bauercito » Mon Dec 07, 2009 5:56 pm

Hi, first of all I'd like to appreciate your contribution with this great plug-in.

I have a little problem adding null data to the graphs. The Open Flash Chart creators have a link regarding this issue and their solution is adding a 'null' value to the data values. But working with your plug-in it doesn't seem to solve my problem. When I add the 'null' value, the graph just doesn't show anything. Is there any special character to use instead of the 'null' value? Am I doing something wrong?

Thanks in advance. I've been looking forward for your reply.
Michel. :)~ :-)~ :smile:
bauercito
Junior Member
 
Posts: 2
Joined: Mon Dec 07, 2009 5:38 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby bauercito » Wed Dec 09, 2009 5:41 pm

bauercito wrote: Hi, first of all I'd like to appreciate your contribution with this great plug-in.

I have a little problem adding null data to the graphs. The Open Flash Chart creators have a link regarding this issue and their solution is adding a 'null' value to the data values. But working with your plug-in it doesn't seem to solve my problem. When I add the 'null' value, the graph just doesn't show anything. Is there any special character to use instead of the 'null' value? Am I doing something wrong?

Thanks in advance. I've been looking forward for your reply.
Michel. :)~ :-)~ :smile:



I finally resolved my doubt, the problem that I had was my maximum value calculation. Because I was sending 'null' values mixed with the numbers, the php max function was trying to compare the string and the numbers giving me a max = 0.

Hope this will help anyone in a further time.
bauercito
Junior Member
 
Posts: 2
Joined: Mon Dec 07, 2009 5:38 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby pmithrandir » Wed Dec 09, 2009 10:46 pm

Hello

thank you for this plugin.

I have 3 questions about your example :

First of all I change the code like that :
Code: Select all
<?php $temp = stOfc::createChartToString(500, 250, 'dashboard/test', false);
echo $temp;?>

But now, I get an empty graph. The createGraph help works fine... seems like a bug ?

Second one is :
I have lot of big queries in my index page with all datas I need. Datas are shared between table and graph. (I use the same result with both)

But here, I have to give an url, and so to ask the same query to the database again.

Do you think there is a way to use my existing variable in place of url ?

Last one :
Do you have a way to do horizontal graph or 3DPie ? Do you think it will take me lot of time to adapt you library if I want to have them ?
Last edited by pmithrandir on Wed Dec 09, 2009 11:06 pm, edited 1 time in total.
pmithrandir
Member
 
Posts: 52
Joined: Mon Aug 24, 2009 1:31 pm
Location: toronto

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Thu Dec 10, 2009 10:58 am

To use the same query for chart and table there are two possible ways.
I know it is not a good practice :cry: but you can store your result so session and once chart is created you can remove your results from sessions.
Or
:idea: Try to use Ajax to create charts. I have not yet given it a try but it should work.

Horizontal bar chart is not available in current version but will be a part of next version. I am already working on it for symfony 1.3/1.4.

3D pie chart will be a part of stOfcPlugin in near future but unfortunately it will not be the part of next release.

It seems that the function createChartToString is having problems. So, I hope that it will also be corrected in the new release.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby pmithrandir » Thu Dec 10, 2009 6:47 pm

drashid wrote: To use the same query for chart and table there are two possible ways.
I know it is not a good practice :cry: but you can store your result so session and once chart is created you can remove your results from sessions.
Or
:idea: Try to use Ajax to create charts. I have not yet given it a try but it should work.

Horizontal bar chart is not available in current version but will be a part of next version. I am already working on it for symfony 1.3/1.4.

3D pie chart will be a part of stOfcPlugin in near future but unfortunately it will not be the part of next release.

It seems that the function createChartToString is having problems. So, I hope that it will also be corrected in the new release.


Thank for your answer

I think I will forget the data load from my current queries for the moment. Maybe you can implement a way to send an array directly to the graph.(or JSON)

Do you have some release date for the next version ? will it be available in symfony 1.2 too ?
My software is currently in developing phase so we can wait some week to have great functionality like horizontal bar chart or pie3D.

Thank you

Pierre
pmithrandir
Member
 
Posts: 52
Joined: Mon Aug 24, 2009 1:31 pm
Location: toronto

Re: (stOfcPlugin) New plug-in to create flash charts

Postby xplo » Fri Dec 11, 2009 11:51 pm

json is the way to use open flash chart especially with a mvc framework like symfony.

I use ofc 'by hand' and i didnt know this plugin, but if i understand it s not possible to use ofcplugin with json ?
xplo
Faithful Member
 
Posts: 593
Joined: Wed Sep 17, 2008 3:23 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby premo » Thu Jan 07, 2010 5:58 am

I am new to this plugin and symfony.
I have the simmilar problem as DexterRSA(message 83350)but I cannot solve it.
I pass the $data as you said but it doesn't work.

In action from plugin - executeLineChart :
public function executeLineChartData(sfWebRequest $request)
{
$data1 = $request->getParameter('data');
$newdata = unserialize($data1);
....
}

in my Controller action:

public function executeWykresy(sfWebRequest $request)
{

$this->data = array(1,2,3,4,5,6,7);
}

in my template - wykresySuccess:

<?php
$data = serialize($data);
stOfc::createChart(750, 325, 'stOfcExample/LineChartData?data='.$data, false); ?>

The result is attached below
Attachments
res.png
res.png (10.58 KiB) Viewed 4691 times
premo
Junior Member
 
Posts: 1
Joined: Thu Jan 07, 2010 5:42 am
Location: poland

Re: (stOfcPlugin) New plug-in to create flash charts

Postby pmithrandir » Thu Jan 07, 2010 3:49 pm

check the generate url size. Maybe the problem is that this one is too big (more than 4096 if I remember well...)
I don't know, but maybe there is a way to use POST in place of GET for parameters...

And I'm not sure you need to serialize /unserialize common string /number(it's a "no sence" for me...)
pmithrandir
Member
 
Posts: 52
Joined: Mon Aug 24, 2009 1:31 pm
Location: toronto

Re: (stOfcPlugin) New plug-in to create flash charts

Postby tkoomzaaskz » Mon Jan 11, 2010 12:41 pm

Dear Drashid,

When can we expect stOfcPlugin to be compatible with sf 1.4? Well, maybe you know that other plugins (which already support 1.4) depend on your plugin ;)~ ;-)~ :wink: it's popular and it needs to support 1.4.

thanks for your work!
User avatar
tkoomzaaskz
Faithful Member
 
Posts: 239
Joined: Fri Feb 01, 2008 1:32 pm
Location: Poland

Re: (stOfcPlugin) New plug-in to create flash charts

Postby drashid » Mon Jan 11, 2010 3:45 pm

@premo:

For me, it is not a problem within the code that you have posted. It should work and you should get a chart as attached. So, whether the example module in plugin runs successfully for you?

@pmithrandir

For
Code: Select all
$data = array(1,2,3,4,5,6,7) ;

serialize($data) will result in:
Code: Select all
a:7:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:5;i:6;i:6;i:7;}

Resulting in URL for data as:
Code: Select all
http://localhost/yourProject/web/frontend_dev.php/stOfcExample/LineChartData?data=a:7:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:5;i:6;i:6;i:7;}

So, could not be the URL length which is causing problem.

Use POST is a great idea but if even there is a way to use POST we must know it. And most of people talk about using the hidden form field to POST data. So, if anyone knows another way to send data by using POST, and shed some light on it, I will love to know that.

Quote: wrote: And I'm not sure you need to serialize /unserialize common string /number(it's a "no sence" for me...)

Once again this might be the lack of knowledge but as you cannot pass an array in URL so, you have to use serialize/unserialize (for complex data) or any other function like (implode/explode).

On the other hand you can store data in session use if for chart and remove it. Now it is up to you which one you prefer.

@tkoomzaasks

As I have said earlier, I am working on the new version and soon it will be available. Actually I am willing to add some new features to the plugin in the coming release but now as it is taking more time than expected so, I think soon there will be a release compatible with symfony 1.4. And after that I will continue the work to add new features.
Attachments
screen shot.png
screen shot.png (11.86 KiB) Viewed 4696 times
Last edited by drashid on Mon Jan 18, 2010 11:01 am, edited 1 time in total.
User avatar
drashid
Member
 
Posts: 57
Joined: Wed Mar 18, 2009 5:59 pm

Re: (stOfcPlugin) New plug-in to create flash charts

Postby roxor972 » Tue Jan 19, 2010 10:00 pm

Hi drashid,

When will be the release compatible with symfony 1.4 available?

Cheers.
roxor972
Junior Member
 
Posts: 19
Joined: Wed Apr 22, 2009 8:50 am

Next

Return to General plug-ins

Who is online

Users browsing this forum: No registered users and 1 guest