有一篇很好用的文章:http://www.lullabot.com/articles/drupal-charting。详细的介绍了各个Drupal的图表模块,很具有参考价值。
一周起始日期
|
Charts
|
Chart
|
FusionCharts
|
2009-12-20
|
1,120
|
1,395
|
295
|
2009-12-13
|
1,140
|
1,474
|
253
|
2009-12-6
|
1,110
|
1,399
|
265
|
平均
|
1,123
|
1423
|
271
|
$chart = '#chart_id' '#title' '#type' ); $chart[ $chart[ $chart[ echo chart_render($chart);'#data']['dairy'] =5;'#data']['meats'] =2;'#data']['fruits']=3;=> CHART_TYPE_PIE_3D,=> t('Servings'),=>'test_chart', array(
$chart = '#chart_id' '#title' '#type' '#size' ); $chart[ $chart[ $chart[ $chart[ $chart[ $chart[ echo chart_render($chart);'#labels'][]= t('Dairy');'#labels'][]= t('Meats');'#labels'][]= t('Fruits');'#data']['dairy'] =5;'#data']['meats'] =2;'#data']['fruits']=3;=> chart_size(400,200),=> CHART_TYPE_PIE,=> chart_title(t('Servings'),'cc0000',15),=>'test_chart', array(
替代方式之一,可以使用颜色模式钩子chart_unique_color()。,它可以关联到多个包含部分或全部相同内容的图表。你也可以考虑一下
$chart = '#chart_id' '#title' '#type' '#size' ); $chart[ $chart[ $chart[ $chart[ $chart[ $chart[ $chart[ $chart[ $chart[ echo chart_render($chart);'#data_colors'][]='0000ff';'#data_colors'][]='ff0000';'#data_colors'][]='00ff00';'#labels'][]= t('Dairy');'#labels'][]= t('Meats');'#labels'][]= t('Fruits');'#data']['dairy'] =5;'#data']['meats'] =2;'#data']['fruits']=3;=> chart_size(400,200),=> CHART_TYPE_PIE,=> chart_title(t('Servings'),'cc0000',15),=>'test_chart', array(
$chart['#legends'][]= t('Fruits');
$chart['#legends'][]= t('Meats');
$chart['#legends'][]= t('Dairy');
$chart['#data_colors'][]='00ff00';
$chart['#data_colors'][]='ff0000';
$chart['#data_colors'][]='0000ff';
$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][0][]= chart_mixed_axis_range_label(0,5);
$chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][1][]= chart_mixed_axis_label(t('Count'),95);
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][]= chart_mixed_axis_label(t('Mon'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][]= chart_mixed_axis_label(t('Tue'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][]= chart_mixed_axis_label(t('Wed'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][]= chart_mixed_axis_label(t('Thu'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][]= chart_mixed_axis_label(t('Fri'));
$chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][2][]= chart_mixed_axis_label(t('Days of the week'),50);
echo chart_render($chart);
echo chart_render($chart);
echo chart_render($chart);