jqplot 图表条之间的宽度

发布于 2024-11-15 16:20:19 字数 296 浏览 5 评论 0原文

如何修改 jqplot 中条形之间的距离?当元素较少时,它们之间的空间太大。这里有两张图片,一张显示了一些条形,第二张显示了较少的条形。

在此处输入图像描述

在此处输入图像描述

显示的条形越少,条形之间的差异越大。我希望能够改变这一点而不会使酒吧变得更胖。我喜欢现在的条形图,但我想让条形图和背景网格线之间的网格宽度尺寸更小。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

哀由 2024-11-22 16:20:19

将 barPadding 设置为负值

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

Set the barPadding to a negative value

seriesDefaults: {
  renderer: $.jqplot.BarRenderer,
  rendererOptions: {
    barPadding: -20
  }
}
红颜悴 2024-11-22 16:20:19

试试这个

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

Try this

seriesDefaults: {
     renderer: $.jqplot.BarRenderer,
     rendererOptions: {                        
           barMargin: 8                        
     }
},
野生奥特曼 2024-11-22 16:20:19

我认为首先你应该设置 barWidth。

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

I think first you should set barWidth.

seriesDefaults: { renderer: $.jqplot.BarRenderer, rendererOptions: {
        barWidth: 15
        } },
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文