javascript - 光泽热图 Highcharts

标签 javascript highcharts heatmap

有没有办法使用 highcharts 为热图添加光泽效果,使其看起来不那么二维。

这是我想要添加完成的热图类型的示例:

http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/heatmap/

我猜这将是一个补充:

plotOptions:{
   heatmap:{
      color: {}
   }
}

但在热图中,颜色会有所不同,因此我无法对其施加通用渐变。

最佳答案

您可以更改 colorAxis 中颜色的计算方式,例如包装 tweenColors 方法并应用渐变:

  (function(H) {
    H.wrap(H.ColorAxis.prototype, 'tweenColors', function(p, from, to, pos) {
      var ret = p.call(this, from, to, pos);

      return {
        radialGradient: {
          cx: 0.1,
          cy: 0.1,
          r: 0.7
        },
        stops: [
          [0, ret],
          [1, Highcharts.Color(ret).brighten(0.2).get('rgb')]
        ]
      }
    });
  })(Highcharts);

演示:http://jsfiddle.net/nkukv1g4/2/

关于javascript - 光泽热图 Highcharts ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35558735/

相关文章:

javascript - 如何使用JQuery PrettyDate插件?

javascript - 为圆形对象fabricjs添加边框

24 小时前的 Javascript 相对时间等作为时间

python - 如何在 Plotly 中制作热图动画

javascript - 将数组的引用存储在数组中

javascript - Google oauth2.0 与组织的网络应用程序?

javascript - Highcharts : Tooltips exist but line is not drawn in the chart

javascript - 如何在 Highcharts 的 <g> 元素中添加 <path> 元素

label - Gnuplot:用图像绘制时不显示标签

visualization - 我可以为 Bokeh 热图绘制颜色条吗?