react中使用echarts地图选中省份高亮问题

我在 react使用echarts配置中国地图 当前选中项无法高亮

<ReactEcharts
option={{

title: false,
tooltip: {
  trigger: 'item',
},
legend: false,
visualMap: {
  min: 0,
  max: maxData,
  left: 'left',
  top: 'bottom',
  calculable: true,
  inRange: {
    color: ['#CCEDF8', '#99DCF1', '#33B9E2']
  },
},
toolbox: {
  show: false,
},
series: [
  {
    name: '',
    type: 'map',
    mapType: 'china',
    roam: false,
    zoom: 1.2, // 改变地图大小
    showLengendSymbol: false, // 去掉地图上的指示点
    label: {
      normal: {
        show: false,
        color: '#fff',
      },
      emphasis: {
        show: true,
        color: '#fff',
        areaColor: '#00A7DB',
      },
    },
    itemStyle: {
      borderWidth: 0,
    },
    emphasis: {
      label: {
        show: true,
        color: '#fff',
      },
      itemStyle: {
        show: true,
        areaColor: '#00A7DB',
      },
    },
    data: dataLst
  }
]

}}
onEvents={onEvents}
style={{ height: '295px', width: '100%' }}
className="react_for_echarts"
/>
let onEvents = {
click: this.onChartClick,
}

我配置了地图高亮颜色但是点击的时候页面刷新选中省份没有高亮显示,

阅读 2.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题