AmCharts Map禁用鼠标悬停时的翻转颜色

时间:2016-10-14 17:23:19

标签: javascript json amcharts

我已经检查了文档,但我找不到它...如何在鼠标悬停时禁用AmCharts Map上的翻转颜色?基本上禁用地图颜色的更改(例如,美国地图上的状态)。我不希望任何鼠标悬停交互或颜色变化。感谢。

var map = AmCharts.makeChart("propertiesMap", {

"type": "map",
"listeners": [{
  "event": "mouseover",
  "method": removeListener
  }],
"dragMap": false,
"theme": "light",
"colorSteps": 5,
"mouseEnabled": false,
"selectable": false,
"zoomOnDoubleClick": false,
"dataLoader": {
    "url": "https://s3-us-west-2.amazonaws.com/s.cdpn.io/t-160/22422.json",
    format: "json",
    "areas": [{
        "mouseEnabled": false
    }]
},

"areasSettings": {
    "autoZoom": false,
    "balloonText": "",
    "outlineThickness": 1,
    "selectable": false,
},

"valueLegend": {
    "right": 10,
    "minValue": "Cold",
    "maxValue": "Hot"
},

"zoomControl": {
    "zoomControlEnabled": false,
    "panControlEnabled": false,
    "homeButtonEnabled": false
}
});

2 个答案:

答案 0 :(得分:1)

要禁用所有州/区域的翻转颜色,请在rollOverColor对象中将null设置为areasSettings

  "areasSettings": {
    // ...
    "rollOverColor": null
  },

Demo

答案 1 :(得分:0)

来自docs

removeListener(chart, type, handler)

所以在你的情况下:

removeListener(myChart, 'mouseover', stateHoverFunction)