Bar Colouring in jqplot
I am attempting to use jqplot to draw a stacked bar chart with the top series being filled in white with a green outline. Is this possible with normal options, or will I have to to it via CSS? The following code is what I am currently using. I've basically tried throwing every color based option at it (I'm confused by the docs, I admit). I was expecting, for the second series, an outline of colour "color" and a fill of colour "fillColor" (i.e. blue and red respectively), but this is not what is happening. Can anyone help?
//Bar Chart
var pots = ['Seats', 'Shoes', 'Refurb', '4 FatC2s', 'Lightweight Four'];
var moneyInPots = [50, 200, 300, 400, 600];
var moneyRemaining = [70, 300, 700, 500, 1900];
plot1 = $.jqplot('potGraph', [moneyInPots, moneyRemaining],
{
stackSeries: true,
seriesDefaults:
{
renderer: $.jqplot.BarRenderer,
pointLabels: {show: true}
},
axes:
{
开发者_如何学Python xaxis:
{
renderer: $.jqplot.CategoryAxisRenderer,
ticks: pots
},
yaxis:
{
min: 0,
tickOptions: {formatString: '£%d'}
}
},
series:
[
{color: 'green', shadow: false},
{color: 'blue', fill: true, fillColor: 'red', fillAndStroke: true, shadow: false, fillToZero: true, fillAxis: 'y'}
]
});
AFAIK, fillAndStroke cannot be used to draw an outline around a bar. This option is used exclusively when you want to add a stroked line to a filled line plot. You can refer to the filledLine.html example available in your JQPlot package.
I do not think there is a way to add an outline around a bar, either through one of the JQPlot options or using CSS.
精彩评论