【问题标题】:Bar Colouring in jqplotjqplot中的条形着色
【发布时间】:2011-06-21 08:46:19
【问题描述】:

我正在尝试使用 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'}
            ]

          });

【问题讨论】:

    标签: jquery jqplot


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2018-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多