alexb
(B Alex )
May 10, 2010, 7:00pm
21
bitmatix:
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);
}
yes, this is pretty much the same code as I was trying with except without the categories, but it still just outputs plain xml onto the screen. I’ve traced code execution inside the getXMLData method and it simply saved the xml into $this->_dataXml and then passes it as an argument to sendChartHeaders, at which point it just prints it and then executes Yii::app()->end(). I’m not sure if that correct or not, since it wont even come back from this function…
colt
(Linija)
May 11, 2010, 7:34am
22
Hello,
I have one I18N question here:)
I can’t get yAxis I18N working (special chars: ąčęėįšųūž )
Added: Yii::app()->fusioncharts->useI18N = true; (still no effect)
Maybe you know what’s the problems?
[edit]
How do I add Multi-Series Chart? I can’t get DateSets working:)
$values = array(
array('value'=>'1'),
array('value'=>'2'),
array('value'=>'3'),
array('value'=>'4'),
array('value'=>'5'),
array('value'=>'6'),
array('value'=>'7'),
);
Yii::app()->fusioncharts->addDataSet('data_unique_key');
Yii::app()->fusioncharts->addSetToDataSet('data_unique_key', $values);
Thanks
CoLT
colt
(Linija)
May 11, 2010, 4:57pm
23
Can’t use tooltip break line tag:
e.g.
<set label='John' value='420' tooltext='John Miller<BR>Score: 420<BR>Rank:2'/>
Yii::app()->fusioncharts->addSet(array('label'=>'test', 'value'=>$test, 'toolText'=>'test <br/>'.$perc.'% test'));
CoLT
Vince
(Vadimg88)
May 14, 2010, 11:21am
24
CoLT:
Hello,
I have one I18N question here:)
I can’t get yAxis I18N working (special chars: ąčęėįšųūž )
Added: Yii::app()->fusioncharts->useI18N = true; (still no effect)
Maybe you know what’s the problems?
[edit]
How do I add Multi-Series Chart? I can’t get DateSets working:)
$values = array(
array('value'=>'1'),
array('value'=>'2'),
array('value'=>'3'),
array('value'=>'4'),
array('value'=>'5'),
array('value'=>'6'),
array('value'=>'7'),
);
Yii::app()->fusioncharts->addDataSet('data_unique_key');
Yii::app()->fusioncharts->addSetToDataSet('data_unique_key', $values);
Thanks
CoLT
What operating system your using? Did you add any kind of other headers to the xml output?
Read the documentation it should be:
$options = array('seriesName' => 'Some name'); // must specify series anme
Yii::app()->fusioncharts->addDataSet('data_unique_key', $options);
// To add a set to a data set use
$options = array('value' => 1);
Yii::app()->fusioncharts->addSetToDataSet('data_unique_key', $options);
CoLT:
Can’t use tooltip break line tag:
e.g.
<set label='John' value='420' tooltext='John Miller<BR>Score: 420<BR>Rank:2'/>
Yii::app()->fusioncharts->addSet(array('label'=>'test', 'value'=>$test, 'toolText'=>'test <br/>'.$perc.'% test'));
CoLT
Should be
Yii::app()->fusioncharts->addSet(array('label'=>'test', 'value'=>$test, 'toolText'=>'test {br}'.$perc.'% test'));
Vince
(Vadimg88)
May 14, 2010, 11:24am
25
alexb:
yes, this is pretty much the same code as I was trying with except without the categories, but it still just outputs plain xml onto the screen. I’ve traced code execution inside the getXMLData method and it simply saved the xml into $this->_dataXml and then passes it as an argument to sendChartHeaders, at which point it just prints it and then executes Yii::app()->end(). I’m not sure if that correct or not, since it wont even come back from this function…
If he returns nothing then maybe there are an error that you did not saw. Turn on error reporting and make sure you can see errors. display_errors set to true.
colt
(Linija)
May 14, 2010, 6:01pm
26
I’m using Wamp@WinXP for development.
Read the documentation it should be:
$options = array('seriesName' => 'Some name'); // must specify series anme
Yii::app()->fusioncharts->addDataSet('data_unique_key', $options);
// To add a set to a data set use
$options = array('value' => 1);
Yii::app()->fusioncharts->addSetToDataSet('data_unique_key', $options);
Strange I still cant get it working.
Controller:
public function actionTestchart()
{
Yii::app()->fusioncharts->setChartOptions( array( 'caption'=>'test', 'xAxisName'=>'testx', 'yAxisName'=>'testy'));
Yii::app()->fusioncharts->addCategory(array('label'=>'Cat1'));
Yii::app()->fusioncharts->addCategory(array('label'=>'Cat2'));
$options = array('seriesName' => 'Series1'); // must specify series anme
Yii::app()->fusioncharts->addDataSet('data_unique_key', $options);
$options = array('seriesName' => 'Series2'); // must specify series anme
Yii::app()->fusioncharts->addDataSet('data_unique_key2', $options);
$options = array('value' => 1);
Yii::app()->fusioncharts->addSetToDataSet('data_unique_key', $options);
$options = array('value' => 2);
Yii::app()->fusioncharts->addSetToDataSet('data_unique_key', $options);
$options = array('value' => 3);
Yii::app()->fusioncharts->addSetToDataSet('data_unique_key2', $options);
$options = array('value' => 4);
Yii::app()->fusioncharts->addSetToDataSet('data_unique_key2', $options);
Yii::app()->fusioncharts->useI18N = true;
Yii::app()->fusioncharts->getXMLData(true);
}
View:
<?php
$this->widget('ext.fusioncharts.fusionChartsWidget', array(
'chartType'=>'Column2D',
'chartNoCache'=>true, // disabling chart cache
'chartAction'=>Yii::app()->urlManager->createUrl('report/testchart'), // the chart action that we just generated the xml data at
'chartId'=>'course_load')); // If you display more then one chart on a single page then make sure you specify and id
?>
XML:
<chart caption="test" xAxisName="testx" yAxisName="testy">
−
<categories>
<category label="Cat1"/>
<category label="Cat2"/>
</categories>
−
<dataset seriesName="Series1">
<set value="1"/>
<set value="2"/>
</dataset>
−
<dataset seriesName="Series2">
<set value="3"/>
<set value="4"/>
</dataset>
</chart>
Chart responses: No data to display.
Other type charts work just fine :]
Still shows {br} instead of new line.
Vince
(Vadimg88)
May 25, 2010, 5:24am
27
Make sure you cleared your cache as flash are cached in the browser. The {br} worked for me when i tested this and posted the correct code above.
colt
(Linija)
May 25, 2010, 12:21pm
28
Hello,
Thanks for reply. I have tried to do as you suggest but nothing happens - No data to display is shown (but the XML is generated) - could you try the code I pasted earlier in this thread?
Best regards,
CoLT
Vince
(Vadimg88)
May 25, 2010, 7:12pm
29
OK I think i know what the problem is. Since your displaying a multiple series chart try using ‘MSColumn2D’ as the chartType in the view instead of the current set ‘Column2D’ which works on a single series chart.
colt
(Linija)
May 25, 2010, 8:29pm
30
Yep, you are definitely right here! MSColumn2D fixed all
Thanks!
[edit]
But one thing bothers me again - Y and X axis does not support local characters
CoLT
Vince
(Vadimg88)
May 26, 2010, 4:04am
31
CoLT:
Yep, you are definitely right here! MSColumn2D fixed all
Thanks!
[edit]
But one thing bothers me again - Y and X axis does not support local characters
CoLT
what charters are u using? I tried it with Hebrew and it worked.
colt
(Linija)
May 26, 2010, 7:37am
32
Its lithuanian "ąčęėįšųūž" (caps "ĄČĘĖĮŠŲŪŽ")
In the top it shows normally, but X and Y axes name just "eats" non latin letters.
Best regards,
CoLT
Vince
(Vadimg88)
May 26, 2010, 5:32pm
33
Just a guess but try to add the following code ABOVE the ‘getXMLData’ method:
header ( 'Content-type: text/xml' );
echo pack ( "C3" , 0xef, 0xbb, 0xbf );
colt
(Linija)
May 26, 2010, 5:59pm
34
Just a guess but try to add the following code ABOVE the ‘getXMLData’ method:
header ( 'Content-type: text/xml' );
echo pack ( "C3" , 0xef, 0xbb, 0xbf );
Hm, I tried like this:
$this->_dataXml = "header ( 'Content-type: text/xml' );";
$this->_dataXml = "echo pack ( 'C3' , 0xef, 0xbb, 0xbf );";
But no effect
Best regards,
CoLT
Vince
(Vadimg88)
May 27, 2010, 11:43am
35
No no no. just add this code
header ( 'Content-type: text/xml' );
echo pack ( "C3" , 0xef, 0xbb, 0xbf );
as it is! above the code
Yii::app()->fusioncharts->getXMLData(true);
in your controller action.
colt
(Linija)
May 27, 2010, 6:22pm
36
No no no. just add this code
header ( 'Content-type: text/xml' );
echo pack ( "C3" , 0xef, 0xbb, 0xbf );
as it is! above the code
Yii::app()->fusioncharts->getXMLData(true);
in your controller action.
Woops, I tried it now as you said But still no change (but in XML output it shows native characters). Strange behaviour.
Thanks for help!
CoLT
Vince
(Vadimg88)
May 27, 2010, 7:35pm
37
What operating system are you using?
Vince
(Vadimg88)
May 30, 2010, 6:01am
39
To be honest i have no clue. It does work for me on Mac and on windows on linux there are certain issues with UTF8 languages displayed inside flash. I would ask at the fusion charts forums.
colt
(Linija)
May 30, 2010, 7:47am
40
Yeah, I also think it could be related with Fusioncharts itself
Thanks for help anyway;)
CoLT