import Component Input OnInit from angularcore;import Chart Util from antvg2;import GetDateService from proxyget-data;import UtilsService from srcappsharedservicesutilsservice;Component selec
150行:
在该行代码中,使用了this.chart.getTheme().colors10[index]来获取图例的颜色。但是在AntV G2版本4.x中,已经将该方法移除,需要使用this.chart.getTheme().defaultColor来获取默认的颜色。所以可以将该行代码修改为:
fill: this.chart.getTheme().defaultColor[index]
170行:
在该行代码中,使用了element.shape.attr('fill')来获取图例的颜色。但是在AntV G2版本4.x中,已经将该方法移除,需要使用element.shape.attr('defaultStyle').fill来获取默认的颜色。所以可以将该行代码修改为:
stroke: element.shape.attr('defaultStyle').fill
172行:
在该行代码中,使用了element.shape.attr('fillOpacity')来获取图例的颜色透明度。但是在AntV G2版本4.x中,已经将该方法移除,需要使用element.shape.attr('defaultStyle').fillOpacity来获取默认的颜色透明度。所以可以将该行代码修改为:
`strokeOpacity: element.shape.attr('defaultStyle').fillOpacity
原文地址: https://www.cveoy.top/t/topic/iF1M 著作权归作者所有。请勿转载和采集!