我在下面有这个高图代码,我正在寻找一种动态传递给它一些值的方法: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 回答
慕田峪4524236
TA贡献1875条经验 获得超5个赞
这可能是因为您正在改变对象并且未检测到更改以重新渲染。
尝试这个:
rendermap = {
...rendermap,
colorAxis: {
...rendermap.colorAxis,
amxColor: "#EEF0EF"
}
}
添加回答
举报
0/150
提交
取消