This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » General plug-ins » (stOfcPlugin) New plug-in to create flash charts
(stOfcPlugin) New plug-in to create flash charts [message #77103] Mon, 20 April 2009 14:46 Go to next message
drashid
Messages: 54
Registered: March 2009
Member
Hi,

I had been looking a plug-in to create charts for my websites but I did not found what I was looking for. Crying or Very Sad

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

http://www.symfony-project.org/uploads/plugins/7acf749251285ecabc1367bd138ffc84.png

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

[Updated on: Mon, 20 April 2009 14:47]

Re: (stOfcPlugin) New plug-in to create flash charts [message #77242 is a reply to message #77103 ] Wed, 22 April 2009 17:36 Go to previous messageGo to next message
pspalves  is currently offline pspalves
Messages: 4
Registered: April 2009
Location: Brazil
Junior Member
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
Re: (stOfcPlugin) New plug-in to create flash charts [message #77244 is a reply to message #77242 ] Wed, 22 April 2009 18:02 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
Ohhh... Shocked

Can you please tell me the version of symfony you are using?

Re: (stOfcPlugin) New plug-in to create flash charts [message #77249 is a reply to message #77244 ] Wed, 22 April 2009 18:40 Go to previous messageGo to next message
pspalves  is currently offline pspalves
Messages: 4
Registered: April 2009
Location: Brazil
Junior Member
version 1.1.5
Re: (stOfcPlugin) New plug-in to create flash charts [message #77252 is a reply to message #77103 ] Wed, 22 April 2009 19:50 Go to previous messageGo to next message
pspalves  is currently offline pspalves
Messages: 4
Registered: April 2009
Location: Brazil
Junior Member
well, for now the problem was temp fixed using the following lines:

starting from line 16 stOfc.class.php
//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" Razz)

Re: (stOfcPlugin) New plug-in to create flash charts [message #77254 is a reply to message #77252 ] Wed, 22 April 2009 20:58 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
That’s exactly where the problem was. Thanks for pointing it out. It will be fixed in the next release. Smile
Re: (stOfcPlugin) New plug-in to create flash charts [message #77351 is a reply to message #77103 ] Fri, 24 April 2009 15:02 Go to previous messageGo to next message
pspalves  is currently offline pspalves
Messages: 4
Registered: April 2009
Location: Brazil
Junior Member
Thanks for the plugin!
My poc is running ok now!

Well done! Keep the good work!
Re: (stOfcPlugin) New plug-in to create flash charts [message #77363 is a reply to message #77103 ] Fri, 24 April 2009 15:59 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
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 Rolling Eyes so, I will try to fix all and commit to repository SVN (coming weekend).
icon3.gif  Re: (stOfcPlugin) New plug-in to create flash charts [message #78055 is a reply to message #77103 ] Sun, 10 May 2009 01:21 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
I got a mail asking that,

Quote:

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

$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

$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
//Passing the random data to bar chart
//$bar->data = $chartData;


Line Chart
//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
//Use line_dot to set line dots diameter, text, color etc.
//$g->line_dot(2, 3, '#3495FE', 'Number of downloads per day', 10);

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

With
$g->data_sets[] = $chartData;


I hope this will be helpful.
Re: (stOfcPlugin) New plug-in to create flash charts [message #78636 is a reply to message #77103 ] Mon, 18 May 2009 20:22 Go to previous messageGo to next message
symf  is currently offline symf
Messages: 27
Registered: May 2009
Junior Member
when I try to create a chart (Bar Chart ) I get the following output:

Quote:

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.
Re: (stOfcPlugin) New plug-in to create flash charts [message #78642 is a reply to message #78636 ] Mon, 18 May 2009 22:55 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
Ooopss… Confused


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).

<?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? Confused

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,

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

[Updated on: Tue, 09 June 2009 09:42]

icon10.gif  Re: (stOfcPlugin) New plug-in to create flash charts [message #78694 is a reply to message #78642 ] Tue, 19 May 2009 19:03 Go to previous messageGo to next message
symf  is currently offline symf
Messages: 27
Registered: May 2009
Junior Member
@drashid

Thank you very much. Smile Your tips helped me. It works now Very Happy
Maybe I was awkward with the execution of the readme instructions but your explanation was helpful for me. Thank you! Surprised

Only one thing was confusing:


Quote:


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



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.


[Updated on: Tue, 19 May 2009 19:21]

Re: (stOfcPlugin) New plug-in to create flash charts [message #78696 is a reply to message #77103 ] Tue, 19 May 2009 21:25 Go to previous messageGo to next message
symf  is currently offline symf
Messages: 27
Registered: May 2009
Junior Member
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:
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???
Re: (stOfcPlugin) New plug-in to create flash charts [message #78700 is a reply to message #78696 ] Tue, 19 May 2009 22:48 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
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.

[Updated on: Wed, 20 May 2009 09:35]

Re: (stOfcPlugin) New plug-in to create flash charts [message #78945 is a reply to message #78700 ] Mon, 25 May 2009 19:34 Go to previous messageGo to next message
symf  is currently offline symf
Messages: 27
Registered: May 2009
Junior Member
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. Very Happy

[Updated on: Mon, 25 May 2009 19:36]

Re: (stOfcPlugin) New plug-in to create flash charts [message #79591 is a reply to message #77103 ] Mon, 08 June 2009 17:40 Go to previous messageGo to next message
HiDDeN  is currently offline HiDDeN
Messages: 135
Registered: July 2006
Location: Barcelona, Spain
Senior Member
Would it be possible to add the Stacked Bars Chart?
Re: (stOfcPlugin) New plug-in to create flash charts [message #79599 is a reply to message #79591 ] Mon, 08 June 2009 22:31 Go to previous messageGo to next message
Lucas0721  is currently offline Lucas0721
Messages: 9
Registered: February 2009
Location: Cucuta
Junior Member
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
Re: (stOfcPlugin) New plug-in to create flash charts [message #79606 is a reply to message #79599 ] Tue, 09 June 2009 10:08 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
@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:
http://localhost/project/web/aplicacion/stOfcExample

or
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

[Updated on: Tue, 09 June 2009 12:19]

Re: (stOfcPlugin) New plug-in to create flash charts [message #79626 is a reply to message #79606 ] Tue, 09 June 2009 15:53 Go to previous messageGo to next message
Lucas0721  is currently offline Lucas0721
Messages: 9
Registered: February 2009
Location: Cucuta
Junior Member
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



  • Attachment: Dibujo.jpg
    (Size: 79.79KB, Downloaded 138 time(s))

[Updated on: Tue, 09 June 2009 15:55]

Re: (stOfcPlugin) New plug-in to create flash charts [message #79671 is a reply to message #79626 ] Wed, 10 June 2009 16:35 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
I have tested the plugin and it works nicely with Opera.

So where the problem is Question

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.
project\web\stOfcPlugin\images\
project\web\stOfcPlugin\js\

And also that you have “open-flash-chart.swf” in the images directory i.e.
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,
$ symfony plugin:install stOfcPlugin

Or you have downloaded the plugin and added it to your project manually.

[Updated on: Wed, 10 June 2009 17:37]

Re: (stOfcPlugin) New plug-in to create flash charts [message #83350 is a reply to message #79671 ] Fri, 07 August 2009 14:27 Go to previous messageGo to next message
dexterRSA  is currently offline dexterRSA
Messages: 2
Registered: August 2009
Location: Stellenbosch
Junior Member
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?

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


Thanks
Re: (stOfcPlugin) New plug-in to create flash charts [message #83380 is a reply to message #83350 ] Fri, 07 August 2009 22:19 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
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.

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

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.
Re: (stOfcPlugin) New plug-in to create flash charts [solved] [message #83573 is a reply to message #83380 ] Tue, 11 August 2009 14:46 Go to previous messageGo to next message
dexterRSA  is currently offline dexterRSA
Messages: 2
Registered: August 2009
Location: Stellenbosch
Junior Member
Hi

My problem is solved now.
I did not unserialze the data that I serialized correctly Smile

Thanks for the help.

Re: (stOfcPlugin) New plug-in to create flash charts [solved] [message #84054 is a reply to message #83573 ] Thu, 20 August 2009 11:37 Go to previous messageGo to next message
Sanjuro  is currently offline Sanjuro
Messages: 28
Registered: June 2008
Junior Member
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 ?
Re: (stOfcPlugin) New plug-in to create flash charts [solved] [message #84224 is a reply to message #84054 ] Mon, 24 August 2009 09:45 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
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.
//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.

[Updated on: Mon, 24 August 2009 15:31]

Re: (stOfcPlugin) New plug-in to create flash charts [solved] [message #84269 is a reply to message #84224 ] Mon, 24 August 2009 15:37 Go to previous messageGo to next message
Sanjuro  is currently offline Sanjuro
Messages: 28
Registered: June 2008
Junior Member
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.
Re: (stOfcPlugin) New plug-in to create flash charts [message #87871 is a reply to message #77103 ] Thu, 05 November 2009 09:35 Go to previous messageGo to next message
mila_1881  is currently offline mila_1881
Messages: 33
Registered: November 2008
Location: tunisia
Member
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???
Re: (stOfcPlugin) New plug-in to create flash charts [message #87914 is a reply to message #87871 ] Fri, 06 November 2009 10:33 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
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.
Re: (stOfcPlugin) New plug-in to create flash charts [message #89002 is a reply to message #87914 ] Mon, 30 November 2009 19:31 Go to previous messageGo to next message
ankalagon  is currently offline ankalagon
Messages: 18
Registered: September 2009
Location: Spain
Junior Member
Great plugin! Very usefull

Cool
icon5.gif  Re: (stOfcPlugin) New plug-in to create flash charts [message #89487 is a reply to message #77103 ] Mon, 07 December 2009 16:56 Go to previous messageGo to next message
bauercito  is currently offline bauercito
Messages: 2
Registered: December 2009
Junior Member
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
Re: (stOfcPlugin) New plug-in to create flash charts [message #89664 is a reply to message #89487 ] Wed, 09 December 2009 16:41 Go to previous messageGo to next message
bauercito  is currently offline bauercito
Messages: 2
Registered: December 2009
Junior Member
bauercito wrote on Mon, 07 December 2009 10:56

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.
Re: (stOfcPlugin) New plug-in to create flash charts [message #89687 is a reply to message #77103 ] Wed, 09 December 2009 21:46 Go to previous messageGo to next message
pmithrandir  is currently offline pmithrandir
Messages: 32
Registered: August 2009
Location: toronto
Member
Hello

thank you for this plugin.

I have 3 questions about your example :

First of all I change the code like that :
<?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 ?

[Updated on: Wed, 09 December 2009 22:06]

Re: (stOfcPlugin) New plug-in to create flash charts [message #89708 is a reply to message #89687 ] Thu, 10 December 2009 09:58 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
To use the same query for chart and table there are two possible ways.
I know it is not a good practice Crying or Very Sad 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.
Re: (stOfcPlugin) New plug-in to create flash charts [message #89756 is a reply to message #89708 ] Thu, 10 December 2009 17:47 Go to previous messageGo to next message
pmithrandir  is currently offline pmithrandir
Messages: 32
Registered: August 2009
Location: toronto
Member
drashid wrote on Thu, 10 December 2009 09:58

To use the same query for chart and table there are two possible ways.
I know it is not a good practice Crying or Very Sad 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
Re: (stOfcPlugin) New plug-in to create flash charts [message #89868 is a reply to message #89756 ] Fri, 11 December 2009 22:51 Go to previous messageGo to next message
xplo  is currently offline xplo
Messages: 428
Registered: September 2008
Faithful Member
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 ?
Re: (stOfcPlugin) New plug-in to create flash charts [message #90937 is a reply to message #89868 ] Thu, 07 January 2010 04:58 Go to previous messageGo to next message
premo  is currently offline premo
Messages: 1
Registered: January 2010
Location: poland
Junior Member
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

  • Attachment: res.png
    (Size: 10.58KB, Downloaded 107 time(s))

Re: (stOfcPlugin) New plug-in to create flash charts [message #90958 is a reply to message #90937 ] Thu, 07 January 2010 14:49 Go to previous messageGo to next message
pmithrandir  is currently offline pmithrandir
Messages: 32
Registered: August 2009
Location: toronto
Member
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...)
Re: (stOfcPlugin) New plug-in to create flash charts [message #91179 is a reply to message #77103 ] Mon, 11 January 2010 11:41 Go to previous messageGo to next message
tkoomzaaskz  is currently offline tkoomzaaskz
Messages: 101
Registered: February 2008
Location: Poland
Senior Member
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!


symfony-world blog
Re: (stOfcPlugin) New plug-in to create flash charts [message #91189 is a reply to message #77103 ] Mon, 11 January 2010 14:45 Go to previous messageGo to next message
drashid
Messages: 54
Registered: March 2009
Member
@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
$data = array(1,2,3,4,5,6,7) ;

serialize($data) will result in:
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:
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:

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.

[Updated on: Mon, 18 January 2010 10:01]

Re: (stOfcPlugin) New plug-in to create flash charts [message #91809 is a reply to message #91189 ] Tue, 19 January 2010 21:00 Go to previous messageGo to previous message
roxor972  is currently offline roxor972
Messages: 17
Registered: April 2009
Junior Member
Hi drashid,

When will be the release compatible with symfony 1.4 available?

Cheers.
Previous Topic:prestaForumConnectorPlugin redirect loop?
Next Topic:SfEasyGmapPlugin and displaying coordinates of a click on a map.
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software