【发布时间】:2011-07-22 18:50:11
【问题描述】:
我正在使用 jqPlot 绘制具有系列默认值 fill: true, fillToZero: true 的 面积图,useNegativeColors 默认为 true。我可以更改color 和fillColor,但我没有找到如何更改零 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
}
};
编辑:添加信息:当前负值默认为蓝色
【问题讨论】:
标签: javascript jquery jqplot