0

我正在尝试使用 jqplot 绘制一个堆叠条形图,顶部系列填充为白色并带有绿色轮廓。这可以通过普通选项实现吗,还是我必须通过 CSS 来实现?以下代码是我目前正在使用的。我基本上已经尝试过将所有基于颜色的选项都扔给它(我承认我对文档感到困惑)。对于第二个系列,我期待颜色“color”的轮廓和颜色“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'}
            ]

          });
4

1 回答 1

0

AFAIK,fillAndStroke 不能用于在条形周围绘制轮廓。当您想要将描边线添加到实心线图时,仅使用此选项。您可以参考 JQPlot 包中提供的filledLine.html 示例。

我认为没有办法通过 JQPlot 选项之一或使用 CSS 在条形周围添加轮廓。

于 2011-06-24T05:32:40.250 回答