You are here

function _seotools_reports_multiline_chart in Drupal SEO Tools 7

Same name and namespace in other branches
  1. 6 seotools.report.inc \_seotools_reports_multiline_chart()
1 call to _seotools_reports_multiline_chart()
seotools_dashboard_referrers_box in ./seotools.report.inc

File

./seotools.report.inc, line 364

Code

function _seotools_reports_multiline_chart($id, $title, $data, $dates, $colors) {
  $shade_colors = array(
    '058DC7' => 'E8F8FF',
    '50B432' => 'DDF4D7',
    'ED561B' => 'FCE4D9',
    'EDEF00' => 'FFFFD6',
  );
  $line_styles = array();
  $shape_markers = array();
  $i = 0;
  foreach ($data as $series) {
    $line_styles[] = chart_line_style(3);

    //$shape_markers[] = chart_shape_marker($i, -1, 'B', 6, $colors[$i]);
    $shape_markers[] = chart_shape_marker($i, -1, 'B', 6, $shade_colors[$colors[$i]]);
    $i++;
  }
  $chart = array(
    '#chart_id' => $id,
    '#title' => '',
    '#type' => CHART_TYPE_LINE,
    '#size' => chart_size(600, 150),
    '#adjust_resolution' => TRUE,
    '#data_colors' => $colors,
    '#line_styles' => $line_styles,
    '#shape_markers' => $shape_markers,
    '#grid_lines' => chart_grid_lines(0, 20, 1, 3),
  );
  $chart['#data'] = $data;
  $chart['#mixed_axis_labels'][CHART_AXIS_Y_LEFT][0][] = chart_mixed_axis_range_label(0, max($data));
  foreach ($dates as $date) {
    $chart['#mixed_axis_labels'][CHART_AXIS_X_BOTTOM][1][] = chart_mixed_axis_label($date);
  }
  return $chart;
}