亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

動態更改高圖值

動態更改高圖值

浮云間 2023-05-11 15:56:16
我在下面有這個高圖代碼,我正在尋找一種動態傳遞給它一些值的方法:let rendermap = Highcharts.mapChart("map-container", {  chart: {    map: "custom/world",  },  borderColor: "#EEF0EF",  colors: ["#CBCDCC", "#6b6b6b"],  mapNavigation: {    enabled: true,    enableDoubleClickZoomTo: true,  },  mapNavigation: {    enabled: true,    buttonOptions: {      theme: {        fill: "rgba(255, 255, 255, 0)",        "stroke-width": 1,        stroke: "#fb9718",        r: 13,        states: {          hover: {            fill: "#fb9718",          },          select: {            stroke: "#039",            fill: "#fb9718",          },        },      },      verticalAlign: "top",      alignValue: "center",    },  },  colorAxis: {    min: 1,    max: 1000,    type: "logarithmic",  },  series: [{    data: mapdata,    borderColor: "#EEF0EF",    joinBy: ["iso-a3", "code3"],    name: "Population density",    states: {      hover: {        color: "#07AABB",      },    },  }, ],});colorAxis例如,我想動態更改顏色選項。我可以這樣做嗎rendermap.colorAxis.amxColor ="#EEF0EF":它似乎不是那樣工作的。
查看完整描述

2 回答

?
Qyouu

TA貢獻1786條經驗 獲得超11個贊

您需要使用update方法,例如:


rendermap.update({

? colorAxis: {

? ? maxColor: "#EEF0EF"

? }

});

查看完整回答
反對 回復 2023-05-11
?
慕田峪4524236

TA貢獻1875條經驗 獲得超5個贊

這可能是因為您正在改變對象并且未檢測到更改以重新渲染。


嘗試這個:


rendermap = {

   ...rendermap,

   colorAxis: {

      ...rendermap.colorAxis,

      amxColor: "#EEF0EF"

   }

}


查看完整回答
反對 回復 2023-05-11
  • 2 回答
  • 0 關注
  • 161 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號