我使用flot绘制特定月份的预定账单付款。如何区分相对于当天绘制的折线图的颜色,即过去的日期应该有一种颜色,未来的日期应该有不同的颜色?
我使用以下代码:
$.plot($("#placeholder1"), [current_d1,current_d2],options_current);
current_d1
和current_d2
是我的两个数组,options_current
是为占位符定义的选项。
var options_current= {
series: {
//dashes: { show: true, shadowSize: 0, steps:true},
lines: { show: true,lineWidth:5,steps:true},
points: { show: true,radius:4 },
color: ('#0000ff'),
threshold: {below:0, color: "#DF0101"}
},
xaxis: {min:1,max :max_value_current, tickFormatter: dayFormatter,tickColor: "rgba(255, 255, 255, 0)", tickDecimals:0,ticks:max_value} ,
yaxis: {min:1,tickFormatter: dollarFormatter} ,
grid: { hoverable: true, clickable: true,
borderWidth: 0,
markings: [
{xaxis: {from:temp_day, to: temp_day}, color: '#A4A4A4'},
{xaxis: {from:1, to: 1}, color: '#000000'},
{yaxis: {from:1, to: 1}, color: '#000000'}
]
},
legend: { position: 'se'}
};