I am using jqPlot to draw an area graph with series defaults fill: true, fillToZero: true
with useNegativeColors
default to true
. I can change the color
and fillColor
but I did not find a way how to change the line color or fill color below zero x-axis line. I want a positive value with green color and a negative value red color. Currently negative value default to blue. Here is the jqPlot option:
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
}
};
Edit: Add info: currently negative value default to blue