jqPlot条形图宽度

Nat*_*Pet 5 width bar-chart jqplot

我目前在jquery中有一个条形图.如果结果只显示1 bar,则问题是条形填充整个图形的空间.如何调整条的宽度,使其看起来不像日志.

Gil*_*rts 6

如果您仍希望图表栏的动态大小与图表的条数/大小相同,则使用barMargin和barPadding值来调整条形图的宽度.

seriesDefaults: {
  renderer: $.jqplot.BarRenderer,
  rendererOptions: { 
    barPadding: 4,
    barMargin: 5
},
Run Code Online (Sandbox Code Playgroud)

默认值分别为8和10,因此上述值实际上会使您的条形更大.使值大于默认值以减小条形图的大小.

barMargin是条形之间的宽度.如果条形图表示多个系列,则barPadding是类别中条形之间的宽度.

有关详细信息,请参阅http://www.jqplot.com/docs/files/plugins/jqplot-barRenderer-js.html.