2013-11-25 88 views
0

我遇到了使用drupal cms生成堆疊條形圖的問題。Drupal cms堆疊谷歌條形圖

我正在使用此API來生成圖表

https://drupal.org/project/google_chart_tools

如圖所示:

> $settings['chart']['chartOne'] = array( 
> 
    'header' => array('Teachers', 'Student'), 
    'rows' => array(array(20, 100)), 
     'columns' => array('people'), 
     'chartType' => 'BarChart', 
     'containerId' => 'content1', 
     'options' => array(
      'forceIFrame' => FALSE, 
      'title' => 'School', 
      'width' => 800, 
      'height' => 400, 
      'isstacked' => TRUE 
     ) 

我怎樣才能使它的圖表,使得在?

例如:

10出來的教師20是男性,其它的10個雌性

50出100名學生是男性和其他50是女性

試圖修改以下和獲取只有教師而空學生:

> $settings['chart']['chartOne'] = array( 
    > 
      'header' => array('Teachers', 'Students'), 
      'rows' => array(array(10),array(10)), array(array(50),array(50)), 
     'columns' => array('Male', 'Female'), 
      'chartType' => 'BarChart', 
      'containerId' => 'content1', 
      'options' => array(
       'forceIFrame' => FALSE, 
       'title' => 'School', 
       'width' => 800, 
       'height' => 400, 
       'isstacked' => TRUE 
      ) 

輸出結果:http://i.stack.imgur.com/V86qQ.png

從OP
+0

什麼了你嘗試到目前爲止實現它? –

+0

我試圖修改: 'header'=> array('Teachers','Student'), 'rows'=> array(array(20 => array(10,10),100 => array(50,50 )), 'columns'=> array('Male','Female'), 但我沒有得到任何結果 –

+0

你會得到什麼? –

回答

0

回答最初被髮布到這個問題


$設置[ '圖'] [ 'chartOne'] =陣列(

  'header' => array('Teachers', 'Students'), 
      'rows' => array(array(10,50),array(10,50)), 
     'columns' => array('Male', 'Female'), 
      'chartType' => 'BarChart', 
      'containerId' => 'content1', 
      'options' => array(
       'forceIFrame' => FALSE, 
       'title' => 'School', 
       'width' => 800, 
       'height' => 400, 
       'isstacked' => TRUE 
      )