Project:Google chart API
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:minor
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

hello,

i'm trying to create a bar chart, but i can't get the grid and the bars to align. This is because every set of bars has a spacing of about 8px, while the spacing between the bars themselves can be manualy been set i cannot find an option to set this other spacing. what can i do to set this spacing? (or rather have it take the value of the bar spacing)

thanks, kevin

Comments

#1

Fwiw, I wanted to achieve the same thing, here's a small patch that I came up with

--- chart.module.orig   2008-12-23 09:53:48.000000000 -0800
+++ chart.module        2008-12-23 09:52:01.000000000 -0800
@@ -549,7 +549,7 @@
      
     // Bar chart bar sizing
     case 'chbh':
-      $data[$attr] .= implode(',', array($value['#size'], $value['#spacing']));
+      $data[$attr] .= implode(',', array($value['#size'], $value['#spacing'], $value['#group_spacing']));
       break;
      
      // Mixed axis positions, labels and styles
@@ -1028,10 +1028,11 @@
*
* @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, 
     );
}

#2

thanks zwoop! your solution worked like a charm.

#3

I would need this in Views integration as well, Bar charts look very weird with those small spacing

Example
Weird Bar Chart with this module

As I understand it may be possible to rotate as well the titles?

#4

Version:6.x-1.2» 6.x-1.x-dev
Component:Miscellaneous» Code
Status:active» patch (to be ported)

Patch for code already committed to 7.x-1.x is attached. Includes constants specified in #345550: Support for absolute/relative chart bar sizing. No views support yet.

AttachmentSize
bar_sizing-324133-4.patch 2 KB

#5

Status:patch (to be ported)» fixed

Manually applied to 6.x-1.x-dev.

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.