在网站中集成了 ZoomCharts,我想通过 chrome 扩展的内容脚本屏蔽图表$99
中的价格。$xxx
但我在 DOM 的图表上找不到任何数值
问问题
54 次
1 回答
1
ZoomCharts 使用 Canvas 来呈现图表。要更改标签内容,您可以像这样使用 styleFunction:http: //jsfiddle.net/7np69cLo/
但是,请注意,您需要访问图表实例才能更改行为。
要从已经实例化的图表的外部脚本执行此操作,您可以这样做:
let e = document.getElementById("demo"); // set to dom element that contains the chart
let chart = e._DVSL_ChartInstance; // get the chart instance
chart.updateSettings({
slice: {
styleFunction: function(slice){
slice.label = "foo";
slice.innerLabel = "bar";
}
}
}); // set your own style function as in the above jsfiddle example
于 2019-12-14T13:06:10.403 回答