Yii Framework Forum: [EXTENSION] Fusion Charts API Extension - Create and share Charts - Yii Framework Forum

Jump to content

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] Fusion Charts API Extension - Create and share Charts Rate Topic: ***** 1 Votes

#1 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 23 April 2010 - 09:48 AM

Discussion and support topic for Fusion Charts API Extension - Create and share Charts
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#2 User is offline   CoLT 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 246
  • Joined: 22-November 09

Posted 24 April 2010 - 11:30 AM

Hey,

Nice extension to have! I have already added it in the Charting list here.

I have tried to test it out and read manual in ext page, created action: klientas/chart:
	public function actionChart()
	{
		Yii::app()->fusioncharts->setChartOptions( array( 'caption'=>'My Chart', 'xAxisName'=>'Months', 'yAxisName'=>'Revenue' ) );

Yii::app()->fusioncharts->addSet(array('label'=>'July', 'value'=>'680000'));
Yii::app()->fusioncharts->addSet(array('label'=>'August', 'value'=>'680000'));
Yii::app()->fusioncharts->addSet(array('label'=>'Jan', 'value'=>'680000'));

    
Yii::app()->fusioncharts->addCategory(array('label'=>'Jan'));
Yii::app()->fusioncharts->addCategory(array('label'=>'Feb'));
Yii::app()->fusioncharts->addCategory(array('label'=>'Mar'));

	}


And in the view added:
<?php


$this->widget('ext.fusioncharts.fusionChartsWidget', array( 
                                                              'chartNoCache'=>true, // disabling chart cache
                                                              'chartAction'=>Yii::app()->urlManager->createUrl('game/chart'), // the chart action that we just generated the xml data at
                                                              'chartId'=>'mychart')); // If you display more then one chart on a single page then make sure you specify and id                 
                                                              
?>


When trying to see the view I got the following error:
PHP Error
Description

Array to string conversion
Source File

C:\wamp\www\p2b7\extensions\fusioncharts\Includes\FusionChartsLib.php(1212)

01200:                        $tempLink=str_replace($pet,$row[$v],$tempLink); 
01201:                 }
01202:               }
01203:           }
01204:          return $tempLink;
01205:      }        
01206: 
01207:      
01208:      # Conversion of semi colon(;) separeted paramater to XML attribute
01209:      function ConvertParamToXMLAttribute($strParam, $isChartParam=false){
01210:                    
01211:          $xmlParam="";
01212: $listArray=explode($this->del,$strParam);
01213:          foreach ($listArray as $valueArray) {
01214:            $paramValue=explode("=",$valueArray);
01215:            if($this->validateParam($paramValue)==true){
01216:                # Create parameter set
01217:                if( $isChartParam==false){
01218:                  $xmlParam .= $paramValue[0] . "='" . $this->encodeSpecialChars($paramValue[1]) . "' ";
01219:                }else{
01220:                   $xmlParam .= $paramValue[0] . "=" . $this->encodeSpecialChars($paramValue[1]) . "&";
01221:                }
01222:            }
01223:         }
01224:         

Stack Trace

#0 C:\wamp\www\p2b7\extensions\fusioncharts\Includes\FusionChartsLib.php(1212): explode()
#1 unknown(0): FusionChartsLib->ConvertParamToXMLAttribute()
#2 C:\wamp\www\p2b7\extensions\fusioncharts\fusionCharts.php(752): call_user_func_array()
#3 unknown(0): fusionCharts->__call()
#4 C:\wamp\www\p2b7\extensions\fusioncharts\views\chartjs.php(6): fusionCharts->ConvertParamToXMLAttribute()
#5 C:\wamp\www\p2b7\lib\yii\web\CBaseController.php(123): require()
#6 C:\wamp\www\p2b7\lib\yii\web\CBaseController.php(88): fusionChartsWidget->renderInternal()
#7 C:\wamp\www\p2b7\lib\yii\web\widgets\CWidget.php(214): fusionChartsWidget->renderFile()
#8 C:\wamp\www\p2b7\extensions\fusioncharts\fusionChartsWidget.php(287): fusionChartsWidget->render()
#9 C:\wamp\www\p2b7\lib\yii\web\CBaseController.php(174): fusionChartsWidget->run()
#10 C:\wamp\www\p2b7\views\klientas\list.php(17): KlientasController->widget()
#11 C:\wamp\www\p2b7\lib\yii\web\CBaseController.php(119): require()
#12 C:\wamp\www\p2b7\lib\yii\web\CBaseController.php(88): KlientasController->renderInternal()
#13 C:\wamp\www\p2b7\lib\yii\web\CController.php(748): KlientasController->renderFile()
#14 C:\wamp\www\p2b7\lib\yii\web\CController.php(687): KlientasController->renderPartial()
#15 C:\wamp\www\p2b7\controllers\KlientasController.php(179): KlientasController->render()
#16 C:\wamp\www\p2b7\lib\yii\web\actions\CInlineAction.php(32): KlientasController->actionList()
#17 C:\wamp\www\p2b7\lib\yii\web\CController.php(300): CInlineAction->run()
#18 C:\wamp\www\p2b7\lib\yii\web\filters\CFilterChain.php(129): KlientasController->runAction()
#19 C:\wamp\www\p2b7\lib\yii\web\filters\CFilter.php(41): CFilterChain->run()
#20 C:\wamp\www\p2b7\lib\yii\web\CController.php(999): CAccessControlFilter->filter()
#21 C:\wamp\www\p2b7\lib\yii\web\filters\CInlineFilter.php(59): KlientasController->filterAccessControl()
#22 C:\wamp\www\p2b7\lib\yii\web\filters\CFilterChain.php(126): CInlineFilter->filter()
#23 C:\wamp\www\p2b7\lib\yii\web\CController.php(283): CFilterChain->run()
#24 C:\wamp\www\p2b7\lib\yii\web\CController.php(257): KlientasController->runActionWithFilters()
#25 C:\wamp\www\p2b7\lib\yii\web\CWebApplication.php(320): KlientasController->run()
#26 C:\wamp\www\p2b7\lib\yii\web\CWebApplication.php(120): CWebApplication->runController()
#27 C:\wamp\www\p2b7\lib\yii\base\CApplication.php(135): CWebApplication->processRequest()
#28 C:\wamp\www\p2b7\www\index.php(13): CWebApplication->run()

2010-04-24 19:25:48 Apache/2.2.11 (Win32) PHP/5.3.0 Yii Framework/1.1.2-dev


Am I doing something wrong?

Greetings
CoLT
0

#3 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 24 April 2010 - 12:53 PM

Oh that's my bad i fixed it and updated the downloads. One more thing is make sure that in the action you print the XML so you will need to add the following code at the end of the action:

Yii::app()->fusioncharts->getXMLData(true);

Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#4 User is offline   CoLT 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 246
  • Joined: 22-November 09

Posted 24 April 2010 - 03:58 PM

View PostVince., on 24 April 2010 - 12:53 PM, said:

Oh that's my bad i fixed it and updated the downloads. One more thing is make sure that in the action you print the XML so you will need to add the following code at the end of the action:

Yii::app()->fusioncharts->getXMLData(true);


Oh thanks, I missed that XML output :)

Now I get the following message in View - Chart screen:
Error in loading data.
(I use the code posted above this post)

controller/chart:
<chart caption="My Chart" xAxisName="Months" yAxisName="Revenue">
<set label="July" value="680000"/>
<set label="August" value="680000"/>
<set label="Jan" value="680000"/>
−
<categories>
<category label="Jan"/>
<category label="Feb"/>
<category label="Mar"/>
</categories>
</chart>


Greets
CoLT
0

#5 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 24 April 2010 - 11:58 PM

Strange using the above code exactly i can see the chart on my localhost. Could you turn on the debug mode by adding

'debugMode' => true


To either the widget instance or the component in the application configuration and refresh the page then copy paste the contents of the debug mode console.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#6 User is offline   CoLT 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 246
  • Joined: 22-November 09

Posted 25 April 2010 - 07:35 AM

View PostVince., on 24 April 2010 - 11:58 PM, said:

Strange using the above code exactly i can see the chart on my localhost. Could you turn on the debug mode by adding

'debugMode' => true


To either the widget instance or the component in the application configuration and refresh the page then copy paste the contents of the debug mode console.


Sorry my mistake ;) Forgot to route right controller/action in the widget. Debug is a must have in these situations :-)

Am, now where do I properly register this extension to full version?

Thanks, great commercial ext!
CoLT
0

#7 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 25 April 2010 - 02:34 PM

Well you just purchase the extension and i assume it will remove the evaluation message to the domain you register to.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#8 User is offline   CoLT 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 246
  • Joined: 22-November 09

Posted 25 April 2010 - 03:57 PM

View PostVince., on 25 April 2010 - 02:34 PM, said:

Well you just purchase the extension and i assume it will remove the evaluation message to the domain you register to.

I mean with Yii ext, have you tried it?:) Maybe licence number is issued or something and set as a parameter.

CoLT
0

#9 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 26 April 2010 - 01:03 AM

Well after reading the docs, When someone purchases a license all he has to do to register is to replace the swf files located under extensions.fusioncharts.assets.Charts with the charts he will download from his client area at the fusion charts home page.

See http://www.fusioncha...radingEval.html
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#10 User is offline   CoLT 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 246
  • Joined: 22-November 09

Posted 26 April 2010 - 04:21 AM

View PostVince., on 26 April 2010 - 01:03 AM, said:

Well after reading the docs, When someone purchases a license all he has to do to register is to replace the swf files located under extensions.fusioncharts.assets.Charts with the charts he will download from his client area at the fusion charts home page.

See http://www.fusioncha...radingEval.html

Oh yeah, now its clear ;)
Clear your browser cache - very important step.
And don't forget Assets directory clear ;)

Its now fully working ext with FusionCharts Evaluation with upgrade instructions :D

Greetings,
CoLT
0

#11 User is offline   bitmatix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 23-March 09

Posted 27 April 2010 - 05:02 AM

There is a little problem with "setChartOptions" method.

In "fusionCharts.php" you have to change the code on line 644:

if($v)


to

if(strlen($v) >0)


otherwise you can't set i.e.:

Yii::app()->fusioncharts->setChartOptions(array('showBorder' => '0'));


EDIT:

to make chart swf transparent add the following line in the extensions view file (located under: PATH_TO_EXTENSIONS/fusioncharts/views/chartjs.php):

myChart_{$chartID}.setTransparent('{$this->chartTransparent}');

0

#12 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 27 April 2010 - 07:01 AM

Thank you i have updated the extension and uploaded a new version.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#13 User is offline   bitmatix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 23-March 09

Posted 27 April 2010 - 07:16 AM

View PostVince., on 27 April 2010 - 07:01 AM, said:

Thank you i have updated the extension and uploaded a new version.


I'm trying to find out what the "chartNoCache" parameter exactly does. Could it be, that there is no function at this time?
0

#14 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 27 April 2010 - 07:22 AM

What it does is that it adds the value returned from microtime in the URL that loads the chart to not save the chart in cache.

edit: the SWF file.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#15 User is offline   bitmatix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 23-March 09

Posted 27 April 2010 - 07:34 AM

View PostVince., on 27 April 2010 - 07:22 AM, said:

What it does is that it adds the value returned from microtime in the URL that loads the chart to not save the chart in cache.

edit: the SWF file.


Sorry Vince,

but I can't see any changes if I set this parameter to "false".
0

#16 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 27 April 2010 - 07:39 AM

Do you use the html version or the JS version? as this only applies to the JS version.

When chartNoCache set to true this is the url that loads the SWF file:

/yiiframeworkcoil/trunk/hangman/assets/7c7e9835/Charts/ScrollLine2D.swf?&nocache=0.37390400 1272371855


When i set that to false this is the url:

/yiiframeworkcoil/trunk/hangman/assets/7c7e9835/Charts/ScrollLine2D.swf?

Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#17 User is offline   bitmatix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 23-March 09

Posted 27 April 2010 - 07:41 AM

View PostVince., on 27 April 2010 - 07:39 AM, said:

Do you use the html version or the JS version? as this only applies to the JS version.

When chartNoCache set to true this is the url that loads the SWF file:

/yiiframeworkcoil/trunk/hangman/assets/7c7e9835/Charts/ScrollLine2D.swf?&nocache=0.37390400 1272371855


When i set that to false this is the url:

/yiiframeworkcoil/trunk/hangman/assets/7c7e9835/Charts/ScrollLine2D.swf?



Ah ok, I see. I use the JS version. Does this bring any speed in loading the chart?
0

#18 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 27 April 2010 - 07:43 AM

the browsers caches the swf file as it caches the images, so basically you should set this to false in production. so it won't the swf for each request but rather load it from the browser cache as it does for images.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#19 User is offline   alexb 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 04-May 10

Posted 10 May 2010 - 01:11 PM

Can't seem to get this to work...

I have this action code in my controller (PostController.php)

	public function actionChart()
	{
		Yii::app()->fusioncharts->setChartOptions(array('caption'=>'My Chart', 'xAxisName'=>'Months', 'yAxisName'=>'Revenue'));

		Yii::app()->fusioncharts->addSet(array('label'=>'July', 'value'=>'680000'));
		Yii::app()->fusioncharts->addSet(array('label'=>'August', 'value'=>'680000'));
		Yii::app()->fusioncharts->addSet(array('label'=>'Jan', 'value'=>'680000'));
		
		Yii::app()->fusioncharts->addCategory(array('label'=>'Jan'));
		Yii::app()->fusioncharts->addCategory(array('label'=>'Feb'));
		Yii::app()->fusioncharts->addCategory(array('label'=>'Mar'));
		
		Yii::app()->fusioncharts->getXMLData(true);
	}


This is my view (chart.php)

$this->widget('ext.fusioncharts.fusionChartsWidget', array( 
 		'chartNoCache'=>true,
 		'chartAction'=>Yii::app()->urlManager->createUrl('post/chart'),
 		'chartId'=>'mychart'));


but all I get back is the data in xml format like this:

<chart caption="My Chart" xAxisName="Months" yAxisName="Revenue">
<set label="July" value="680000"/>
<set label="August" value="680000"/>
<set label="Jan" value="680000"/>
−
<categories>
<category label="Jan"/>
<category label="Feb"/>
<category label="Mar"/>
</categories>
</chart>


...no chart...

I'm sure I'm overlooking something...
0

#20 User is offline   bitmatix 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 23-March 09

Posted 10 May 2010 - 01:42 PM

View Postalexb, on 10 May 2010 - 01:11 PM, said:

Can't seem to get this to work...

I have this action code in my controller (PostController.php)

	public function actionChart()
	{
		Yii::app()->fusioncharts->setChartOptions(array('caption'=>'My Chart', 'xAxisName'=>'Months', 'yAxisName'=>'Revenue'));

		Yii::app()->fusioncharts->addSet(array('label'=>'July', 'value'=>'680000'));
		Yii::app()->fusioncharts->addSet(array('label'=>'August', 'value'=>'680000'));
		Yii::app()->fusioncharts->addSet(array('label'=>'Jan', 'value'=>'680000'));
		
		Yii::app()->fusioncharts->addCategory(array('label'=>'Jan'));
		Yii::app()->fusioncharts->addCategory(array('label'=>'Feb'));
		Yii::app()->fusioncharts->addCategory(array('label'=>'Mar'));
		
		Yii::app()->fusioncharts->getXMLData(true);
	}


This is my view (chart.php)

$this->widget('ext.fusioncharts.fusionChartsWidget', array( 
 		'chartNoCache'=>true,
 		'chartAction'=>Yii::app()->urlManager->createUrl('post/chart'),
 		'chartId'=>'mychart'));


but all I get back is the data in xml format like this:

<chart caption="My Chart" xAxisName="Months" yAxisName="Revenue">
<set label="July" value="680000"/>
<set label="August" value="680000"/>
<set label="Jan" value="680000"/>
−
<categories>
<category label="Jan"/>
<category label="Feb"/>
<category label="Mar"/>
</categories>
</chart>


...no chart...

I'm sure I'm overlooking something...


have you tried the following?

        public function actionChart()
        {
                Yii::app()->fusioncharts->setChartOptions(array('caption'=>'My Chart', 'xAxisName'=>'Months', 'yAxisName'=>'Revenue'));

                Yii::app()->fusioncharts->addSet(array('label'=>'July', 'value'=>'680000'));
                Yii::app()->fusioncharts->addSet(array('label'=>'August', 'value'=>'680000'));
                Yii::app()->fusioncharts->addSet(array('label'=>'Jan', 'value'=>'680000'));

                Yii::app()->fusioncharts->getXMLData(true);
        }

0

Share this topic:


  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users