我正在使用jqPlot绘制具有系列默认值的区域图fill: true, fillToZero: true
,useNegativeColors
默认值为true
. 我可以更改color
andfillColor
但我没有找到如何更改零 x 轴线以下的线条颜色或填充颜色的方法。我想要一个绿色的正值和一个红色的负值。当前负值默认为蓝色。这是 jqPlot 选项:
var chartOptions = {
title: { show: false },
axesDefaults: {
show: false,
showGridline: false,
borderWidth: 0,
showTicks: false,
showTickMarks: false,
tickOptions: {
show: false,
showLabel: false,
showMark: false,
showGridline: false
}
},
axes: {
xaxis: { min: 0, max: 10 },
yaxis: { min: -5, max: 5 }
},
seriesDefaults: {
fill: true,
fillToZero: true,
fillAndStroke: true,
color: "rgba(190,230,110, 0.8)",
fillColor: "rgba(206,236,145, 0.8)",
shadow: false,
showMarker: false,
lineWidth: 1,
rendererOptions: {
highlightMouseOver: false
}
},
legend: { show: false },
grid: {
drawGridLines: false,
background: "rgba(255,255,255,0)",
shadow: false
}
};
编辑:添加信息:当前负值默认为蓝色