You can add
echo $flashChart->chart('bar_glass',array('colour'=>'#33cc33','key'=>array('Computer',12)),'Set1','dig');
in
'key'=array('your label',12) that is label you can set...
but what about if i want to label the particular value? for example, in the pie chart. there are 4 sectors
rabbit = 1
mouse = 3
cat = 6
dog = 9
i want to show the name of each animal together with its corresponding value in the pie chart.
echo $flashChart->render('100%',500,'dig');
?>
1.1 data set = 1 bar
2.a chart has id(dig) it's mean morethan 1 chart per page.
'key'=>array('Doc ','13'
13=font size
i use the following code to generate the pie chart and it is ok.
echo $flashChart->begin(array('prototype'=>true));
$flashChart->setTitle('title', '{color:#f1a334;font-size:25px;padding-bottom:20px;}');
echo $flashChart->setData(array(1,3,6,9), '{n}', false, 'stuff');
echo $flashChart->chart('pie', array(), 'stuff', 'chart1');
echo $flashChart->render(400, 400, 'chart1', 'chartDomId1');
but instead of showing numbers, i want to display the label of the data. i tried to create the label following the example below. but it doesn't work. http://code.google.com/p/alkemann/wiki/ExampleCustomize
anyone can help? thanks very much for your help.
Kit
You can add
echo $flashChart->chart('bar_glass',array('colour'=>'#33cc33','key'=>array('Computer',12)),'Set1','dig');
in
'key'=array('your label',12) that is label you can set...
now i can add key by used:'key'=>'Computer' echo $flashChart->chart('bar_glass',array('colour'=>'#33cc33','key'=>'Computer'),'Set1','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#D54C78','key'=>'Computer2'),'Set2','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#3334AD','key'=>'Computer3'),'Set3','dig');
but my page show an error Warning (2): Missing argument 2 for bar_base::set_key(), called in D:\wamp\www\024_kpi2\app\views\helpers\flash_chart.php on line 466 and defined [APP\vendors\flashchart\ofc_bar_base.php, line 13]
Code | Context
$text = "Computer"
* @param $size as integer, size in pixels
*/
function set_key( $text, $size )
bar_base::set_key() - APP\vendors\flashchart\ofc_bar_base.php, line 13
FlashChartHelper::chart() - APP\views\helpers\flash_chart.php, line 466
include - APP\views\mains\index.ctp, line 22
View::_render() - CORE\cake\libs\view\view.php, line 662
View::render() - CORE\cake\libs\view\view.php, line 376
Controller::render() - CORE\cake\libs\controller\controller.php, line 799
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 230
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 194
[main] - APP\webroot\index.php, line 88
Notice (8): Undefined variable: size [APP\vendors\flashchart\ofc_bar_base.php, line 17]
How to solve it?............
At last I can do it by
'key'=>array('Computer',12) echo $flashChart->chart('bar_glass',array('colour'=>'#33cc33','key'=>array('Computer',12)),'Set1','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#D54C78','key'=>array('Computer2',12)),'Set2','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#3334AD','key'=>array('Computer3',12)),'Set3','dig');
but what about if i want to label the particular value? for example, in the pie chart. there are 4 sectors
rabbit = 1
mouse = 3
cat = 6
dog = 9
i want to show the name of each animal together with its corresponding value in the pie chart.
is that possible? thanks.
1.1 data set = 1 bar<?php
//print_r($data1);
echo $flashChart->begin();
$flashChart->setTitle('Title Name',array('{font-size:20px}'));
$flashChart->setData($data1,'{n}.Point.point','{n}.Indicator.code','Set1','dig');
$flashChart->setData($data2,'{n}.Point.point','{n}.Indicator.code','Set2','dig');
$flashChart->setData($data3,'{n}.Point.point','{n}.Indicator.code','Set3','dig');
$flashChart->setData($data4,'{n}.Point.point','{n}.Indicator.code','Set4','dig');
$flashChart->setLegend('x','X Legend ');
$flashChart->setLegend('y','Y Legend' );
$flashChart->axis('y',array('range' => array(0, 3, 1),'labels' => array('','1','2','3')));
$flashChart->axis('x',array('range' => array(0, 14, 1),'labels' => array('','1','2','3','4','5','6','7','8','9','10','11','12','13','14')));
$flashChart->setBgColour('FFFFE1');
//$flashChart->ready = 'alert("ready");' ;
//$flashChart->loading = 'alert("Processing");' ;
$flashChart->setToolTip(false, array(
'proximity' => true,
'colour' => '338833',
'stroke' => 3,
'hover' => true));
echo $flashChart->chart('bar_glass',array('colour'=>'#33cc33','key'=>array('Rabit ','13')),'Set1','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#D54C78','key'=>array('Mouse ','13')),'Set2','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#3334AD','key'=>array('Cat ','13')),'Set3','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#333333','key'=>array('Doc ','13')),'Set4','dig');
echo $flashChart->render('100%',500,'dig');
?>
2.a chart has id(dig) it's mean morethan 1 chart per page.
'key'=>array('Doc ','13'13=font sizeYou can add
echo $flashChart->chart('bar_glass',array('colour'=>'#33cc33','key'=>array('Computer',12)),'Set1','dig');in'key'=array('your label',12)that is label you can set...echo $flashChart->chart('bar_glass',array('colour'=>'#33cc33','key'=>'Computer'),'Set1','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#D54C78','key'=>'Computer2'),'Set2','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#3334AD','key'=>'Computer3'),'Set3','dig');
but my page show an error
Warning (2): Missing argument 2 for bar_base::set_key(), called in D:\wamp\www\024_kpi2\app\views\helpers\flash_chart.php on line 466 and defined [APP\vendors\flashchart\ofc_bar_base.php, line 13]
Code | Context
$text = "Computer"
* @param $size as integer, size in pixels
*/
function set_key( $text, $size )
bar_base::set_key() - APP\vendors\flashchart\ofc_bar_base.php, line 13
FlashChartHelper::chart() - APP\views\helpers\flash_chart.php, line 466
include - APP\views\mains\index.ctp, line 22
View::_render() - CORE\cake\libs\view\view.php, line 662
View::render() - CORE\cake\libs\view\view.php, line 376
Controller::render() - CORE\cake\libs\controller\controller.php, line 799
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 230
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 194
[main] - APP\webroot\index.php, line 88
Notice (8): Undefined variable: size [APP\vendors\flashchart\ofc_bar_base.php, line 17]
How to solve it?............
At last I can do it by
'key'=>array('Computer',12)echo $flashChart->chart('bar_glass',array('colour'=>'#33cc33','key'=>array('Computer',12)),'Set1','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#D54C78','key'=>array('Computer2',12)),'Set2','dig');
echo $flashChart->chart('bar_glass',array('colour'=>'#3334AD','key'=>array('Computer3',12)),'Set3','dig');
$bar->key('mykey');in this tuterial i can't find that, help me please....T T