jqPlot - 在日期将填充值设置为零

时间:2012-09-03 21:51:42

标签: jquery jqplot

问题是它始终在我的图表开始前两天显示。我试图设置正常值的pad: 0min: 0,但日期值不是很多。

实施例:
我的数组从2012.09.01开始,但图表从2012.8.30开始。

描述问题的图像

enter image description here

代码

var plot1 = $.jqplot('chart-dashboard', [line1, line2, line3], {
        series: [{ color: '#333333', label: '1' }, { color: '#999999', label: '2' }, { color: 'green', label: '3'}],
        axes: {
            xaxis: {
                renderer: $.jqplot.DateAxisRenderer,
                tickOptions: {
                    formatString: '%b %#d'
                },
                // pad: 0 // does not work
                // min: 0 // does not work
            },
            yaxis: {
                min: 0 // works because it's not a date
            }
        },
        highlighter: {
            show: true,
            sizeAdjust: 7.5
        },
        cursor: {
            show: false
        },
        legend: {
            show: true
        }
});

1 个答案:

答案 0 :(得分:0)

详细说明解决此问题的方法

Padding values on inverted axis in jqplot

总之,您应该使用

或者

xaxis: {
     pad:0,
     ....
}

或者

xaxis: {
     min:'2012.09.01',
     max: ....
}

因为如果设置最大分钟

pad 将不起作用
相关问题