diff --git a/chart.module b/chart.module index 2e6da2d..5a3e374 100644 --- a/chart.module +++ b/chart.module @@ -72,6 +72,13 @@ define('CHART_LEGEND_TOP_VERTICAL', 'tv'); define('CHART_LEGEND_RIGHT', 'r'); define('CHART_LEGEND_LEFT', 'l'); +/** + * Bar Width and Spacing + */ +define('CHART_ABSOLUTE_SPACING', 'a'); +define('CHART_RELATIVE_SPACING', 'r'); + + /*----------------------------------------------------------------- * Hook Implementations *------------------------------------------------------------------*/ @@ -236,8 +243,8 @@ function chart_copy($chart, $name = NULL, $dest = 'charts', $replace = FILE_EXIS * - #mixed_axis_labels: (chxt) (Optional) An array of mixed axis labels. * - #mixed_axis_label_styles: (chxs) (Optional) An array of mixed axis label * styles. - * - #bar_size: (chbh) (Optional) 'a' for automatic, 'r' for relative, or an - array using keys: #size and #spacing. + * - #bar_size: (chbh) (Optional) A string or an array using keys: #size, + * #spacing, $group_spacing. * - #countries: (chld) (Optional) An array of countries. * - #georange: (chtm) (Optional) The geographical scope. * @@ -594,7 +601,7 @@ function _chart_append($attr, $value, &$data) { $data[$attr] .= $value; } else { - $data[$attr] .= implode(',', array($value['#size'], $value['#spacing'])); + $data[$attr] .= implode(',', array($value['#size'], $value['#spacing'], $value['#group_spacing'])); } break; @@ -1084,12 +1091,16 @@ function chart_range_marker($start, $end, $virtical = TRUE, $color = '000000') { * @param int $spacing * (optional) Pixel spacing between bars. * + * @param int $group_spacing + * (optional) Pixel spacing between bars. + * * @return array */ -function chart_bar_size($size = 40, $spacing = 20) { +function chart_bar_size($size = 40, $spacing = 20, $group_spacing = 30) { return array( '#size' => $size, '#spacing' => $spacing, + '#group_spacing' => $group_spacing, ); }