我试图用jqplot绘制一个堆积的条形图,顶部系列用白色填充绿色轮廓 . 这是可能的正常选项,还是我必须通过CSS?以下代码是我目前使用的代码 . 我基本上尝试过抛出每种颜色的选项(我承认,我对文档感到困惑) . 对于第二个系列,我期待着颜色“颜色”的轮廓和颜色“fillColor”的填充(分别是蓝色和红色),但这不是正在发生的事情 . 有人可以帮忙吗?
//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:
{
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'}
]
});
1 回答
AFAIK,fillAndStroke不能用于在条形图周围绘制轮廓 . 如果要将描边线添加到实线图中,则此选项专门用于此选项 . 您可以参考JQPlot包中提供的filledLine.html示例 .
我不认为有一种方法可以通过一个JQPlot选项或使用CSS在条形图周围添加轮廓 .