Highcharts heatmap - disabling the legend results

2019-05-23 08:32发布

问题:

I am using a Highcharts heatmap and if I disable the legend by setting

legend: {
    enabled: false
}

the colors used in the chart are different. I am also providing some colorAxis info like a min, max and stops. Here is a fiddle that illustrates the issue I'm having.

How can I get Highcharts to use the same colors that it uses when the legend is enabled, but disable the legend?

回答1:

It looks like a possibly bug, so I reported that to our developers here: https://github.com/highcharts/highcharts/issues/5205

Workaround:

  • set tickPositions for colorAxis - http://jsfiddle.net/vLtc1tz6/1/
  • set to false startOnTick and endOnTick for colorAxis - http://jsfiddle.net/vLtc1tz6/2/