barwidth option is not working on jquery flot

蹲街弑〆低调 提交于 2019-11-29 18:09:53

barWidth is a series option, you can specify it globally or per series:

Globally:

...
series: { // you are missing this
    bars: {
        barWidth: 24 * 60 * 60,
    },
}
...

Per Series:

{ data: data[1].data, bars: { show: true, barWidth: 24 * 60 * 60 }, yaxis: 2, label:"# Of Calls" } // set second series to use second axis

Since your x-axis is time, the units are milliseconds. By specifying a bar width of 24*60*60 you're setting the width to be 1/1000th of a day, or about 1.5 minutes. For a chart that spans several months, 1.5 minutes is tiny and may not be what you want. If you want your bar widths to be a day, then you should specify a bar width of 24*60*60*1000 instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!