Question

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.

Was it helpful?

Solution

Set the barPadding to a negative value

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

OTHER TIPS

Try this

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

I think first you should set barWidth.

seriesDefaults: { renderer: $.jqplot.BarRenderer, rendererOptions: {
        barWidth: 15
        } },
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top