You are here

function _quant_generate_chart_count in Quant 6

Take formatted data for a count chart and convert to a format that the charts can understand

File

includes/chart.inc, line 125
Chart building functions

Code

function _quant_generate_chart_count(&$quant) {
  $max = 0;

  // Determine the highest available value on y-axis
  foreach ($quant->data as $key => $value) {
    $quant->chart['#data'][] = $value;

    // If pie chart, let's add the numeric value to the label
    if ($quant->chartType == 'pie') {
      quant_x_label($quant, $key . ' (' . $value . ')');
    }
    else {
      quant_x_label($quant, $key);
    }
    $max = max($max, $value);
  }
  quant_y_range($quant, 0, $max);
  $quant->render = chart_render($quant->chart);
}