Highcharts heatmap - disabling the legend results in different colors

时光总嘲笑我的痴心妄想 提交于 2019-12-08 02:08:01

问题


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/


来源:https://stackoverflow.com/questions/36557590/highcharts-heatmap-disabling-the-legend-results-in-different-colors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!