我正在使用 jqplot 绘制一个简单的条形图,但是只呈现了第一个和最后一个条形图的一半。 这是图片
有没有办法让图表适合里面??
谢谢
更新 在 xAxis 上,我使用 dateAxisRenderer 作为渲染器。
最佳答案
在 axes: { xaxis: { } }
选项下,我会尝试使用:
min: null, // minimum numerical value of the axis. Determined automatically.
max: null, // maximum numverical value of the axis. Determined automatically.
pad: 1.2, // a factor multiplied by the data range on the axis to give the
// axis range so that data points don't fall on the edges of the axis.
选项。先敲击垫子,如果不起作用,您应该尝试将最小值和最大值设置为略大于您的数据范围。
评论编辑
我认为如果您使用自 1970/01/01 以来的毫秒数 javascript 标准,您会发现使用日期会容易得多。这就是为什么使用 min/max 作为字符串时会出错的原因。像这样指定它:
min: 1325376000 * 1000, // 2012/01/01 00:00:00
max: 1326715140 * 1000 // 2012/01/16 11:59:00
下一个障碍是您的约会对象没有时间。 JQPlot 将这些作为当天的第一分钟,因此它们与标签相应地对齐。如果您希望它们居中对齐,则需要指定中午 12:00 的时间。同样,您可以从字符串中解析它,但我会切换到毫秒。
关于javascript - jqplot 在视觉区域外渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8914814/