gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 06:00:00 24 4
gpt4 key购买 nike

问题是它总是在我的图表开始前两天显示。我尝试设置 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
}
});

最佳答案

这里描述了解决您问题的详细方法

Padding values on inverted axis in jqplot

总而言之,您应该使用

或者

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

或者

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

因为如果设置ma​​xminpad将不起作用

关于jquery - jqPlot - 在日期上将填充值设置为零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12254414/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com