Charts

From BarbWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "working well on -dev. May want to install views_calc to test more capabilities. NOT on -test, production")
Line 1: Line 1:
-
working well on -dev. May want to install views_calc to test more capabilities. NOT on -test, production
+
sample pie chart code <br />
 +
<?php
 +
 
 +
  $chart = array(
 +
      '#chart_id' => 'current_status_chart',
 +
      '#title' => chart_title(t('Types of published materials'), '660000', 15),
 +
      '#type' => CHART_TYPE_PIE_3D,
 +
      '#size' => chart_size(500, 250),
 +
    );
 +
   
 +
  $chart['#data']['Theses'] = 10;
 +
  $chart['#data']['Journal Articles'] = 28;
 +
  $chart['#data']['Reports'] = 62;
 +
 
 +
  $chart['#labels'][] = t('Theses');
 +
  $chart['#labels'][] = t('Journal Articles');
 +
  $chart['#labels'][] = t('Reports');
 +
 
 +
  $chart['#data_colors'][] = '678867';
 +
  $chart['#data_colors'][] = '0f568c';
 +
  $chart['#data_colors'][] = 'e81a05';
 +
 
 +
  echo chart_render($chart);
 +
?>

Revision as of 19:00, 25 May 2011

sample pie chart code
<?php

 $chart = array(
     '#chart_id' => 'current_status_chart',
     '#title' => chart_title(t('Types of published materials'), '660000', 15),
     '#type' => CHART_TYPE_PIE_3D,
     '#size' => chart_size(500, 250),
   );
   
 $chart['#data']['Theses'] = 10;
 $chart['#data']['Journal Articles']  = 28;
 $chart['#data']['Reports']  = 62;
 $chart['#labels'][] = t('Theses');
 $chart['#labels'][] = t('Journal Articles');
 $chart['#labels'][] = t('Reports');
 
 $chart['#data_colors'][] = '678867';
 $chart['#data_colors'][] = '0f568c';
 $chart['#data_colors'][] = 'e81a05';
 echo chart_render($chart);

?>

Personal tools