Luis Alvarado
Luis Alvarado

Reputation: 9406

jqplot width between graph bars

How can I modify the distance between the bars in jqplot. There is too much space between them when there are less elements on it. Here are 2 images, one with some bars showing and the second one with less bars showing.

enter image description here

enter image description here

The less bars that show, the bigger the difference between bars. I want to be able to change this WITHOUT making the bars fatter. I like the bars like they are right now but I want to make the grid width size smaller between the bar and the grid lines in the background.

Upvotes: 0

Views: 6961

Answers (3)

Saif
Saif

Reputation: 51

Try this

seriesDefaults: {
     renderer: $.jqplot.BarRenderer,
     rendererOptions: {                        
           barMargin: 8                        
     }
},

Upvotes: 4

user2042231
user2042231

Reputation: 1

I think first you should set barWidth.

seriesDefaults: { renderer: $.jqplot.BarRenderer, rendererOptions: {
        barWidth: 15
        } },

Upvotes: 0

Paul
Paul

Reputation: 18597

Set the barPadding to a negative value

seriesDefaults: {
  renderer: $.jqplot.BarRenderer,
  rendererOptions: {
    barPadding: -20
  }
}

Upvotes: 5

Related Questions