我在使用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
)
我怎样才能把它写在图表上?
示例:
20名教师中有10名是男性,另外10名是女性
100名学生中有50名是男性,另外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
)
输出结果:https://i.stack.imgur.com/V86qQ.png
最初发布到问题中的OP的答案
$settings['chart']['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 )