gRaphael: How to increase spacing between bars in bar graph

1.7k views Asked by At

I have created a horizontal bar graph using gRaphael charting library. I want to increase the spacing between the bars. Is there an option to do that?

3

There are 3 answers

0
Kenny Shen On BEST ANSWER

Well, from what I know there's not exactly a way to increase spacing but you can do so by manipulating the gutter value during initialization.

See:

g.raphael docs here

0
climboid On

increase the gutter. It can be received as an option or just change g.bar.js

0
HeyWatchThis On

From what I have seen using the dotchart, the spacing is controlled indirectly using the width and height of a chart.

I originally thought that the x_coords and y_coords variables I have below specify the exact pixel locations of the data, but it appears they only indirectly control this.

var r = Raphael(div_tag);  

r.dotchart(x_center,y_center,width,height,x_coords,y_coords,data, {symbol: "o", max: 10, heat: true, axis: "0 0 1 1", axisxstep: axisx_step, axisystep: axisy_step, axisxlabels: g_xaxis, axisxtype: " ", axisytype: " ", axisylabels: g_yaxis}

So the spacing is proportional to width/(# of values on the x axis) .