You are here

function statspro_chart_summary in Statistics Pro 6

Same name and namespace in other branches
  1. 6.2 statspro_overview.inc \statspro_chart_summary()

File

./statspro.reports.inc, line 102
Include file for statistics report page

Code

function statspro_chart_summary($title, $stats) {
  $data = array();
  foreach ($stats as $result) {
    $data[] = array(
      '#value' => $result[1],
      '#label' => strip_tags($result[0]) . ': ' . $result[1],
    );
  }
  if (!empty($data)) {
    $chart = array();
    $chart[0] = $data;
    $chart['#title'] = $title;
    $chart['#type'] = 'pie2D';
    $chart['#width'] = 700;
    $chart['#height'] = 200;
    return '<div align="center">' . charts_chart($chart) . '</div>';
  }
  return '';
}