显示热力图图例和常规图例一起在Highcharts中。

huangapple go评论76阅读模式
英文:

Display heatmap legend and regular legend together in highcharts

问题

如何在Highcharts中同时显示热力图图例和常规图例?

我在Highcharts中制作了一个热力图,上面还叠加了样条系列。我喜欢热力图显示的特殊颜色轴图例,但不幸的是,这意味着样条系列中没有显示。

其他系列更重要,如果我愿意,我可以阻止热力图显示在图例中,而选择它们...但是否可能同时显示两者?

英文:

How do I display both a heatmap legend and regular legend with highcharts?

I've got a heatmap I've made in highcharts that also has spline series laid over it. I love the special color axis legend that shows for the heatmap, but unfortunately it means none of the spline series show up with it.

The other series are more important, and I can just prevent the heatmap from showing on the legend if I want them instead... but is it possible to display both?

答案1

得分: 0

可以在Highcharts中显示颜色轴和常规图例项目,只需为特定系列启用showInLegend选项。

  系列: [{
    showInLegend: true,
    ...
  }, {
    showInLegend: true,
    ...
  }]

在线演示: https://jsfiddle.net/BlackLabel/amw63xke/

API参考: https://api.highcharts.com/highcharts/series.line.showInLegend

英文:

It is possible to show color-axis and regular legend items in Highcharts, you need to only enable showInLegend option for a specific series.

  series: [{
    showInLegend: true,
    ...
  }, {
    showInLegend: true,
    ...
  }]

Live demo: https://jsfiddle.net/BlackLabel/amw63xke/

API Reference: https://api.highcharts.com/highcharts/series.line.showInLegend

huangapple
  • 本文由 发表于 2023年5月25日 01:32:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76326083.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定