簡體   English   中英

Highcharts條形圖中的陰影

[英]Shadow in Highcharts bar chart

我想在酒吧的右側給5個px陰影。 可能嗎?

我想在右側給5個px陰影o

您應該使用允許在圖表中添加自定義路徑的渲染器。 知道這一點,捕獲load事件並迭代每個系列點,在右側添加線。

chart: {
  type: 'column',
  events: {
    load: function() {
      var chart = this,
        series = chart.series,
        each = Highcharts.each,
        r = chart.renderer,
        borderWidth  = 2,
        x,y;

      each(series, function(s, i) {
        each(s.data, function(p, j) {
                        x = p.plotX + chart.plotLeft + (p.pointWidth / 2);
                        y = p.plotY + chart.plotTop + borderWidth;

          r.path(['M', x, y, 'L', x, y + p.shapeArgs.height])
          .attr({
            zIndex: 10,
            'stroke-width': borderWidth,
            'stroke': 'gray'
          })
          .add()
        });
      });
    }
  }
},

示例: - http://jsfiddle.net/2reombm7/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM