问题描述
function am4themes_sdTheme(target) {
if (target instanceof am4core.InterfaceColorSet) {
target.setFor('text',am4core.color('#ffffff')); // text color
target.setFor('grid',am4core.color('#ffffff')); // line color
}
}
am4core.useTheme(am4themes_sdTheme);
谢谢!
解决方法
那是一个 tick,而不是一个网格。您必须单独定位它:
function am4themes_sdTheme(target) {
if (target instanceof am4core.InterfaceColorSet) {
target.setFor('text',am4core.color('#ffffff'));
}
if (target instanceof am4charts.Tick) {
target.strokeOpacity = 0;
}
}
am4core.useTheme(am4themes_sdTheme);
Tick 扩展了不同类型的元素,因此如果您想区分饼图、轴刻度等,您可能需要更具体并使用 PieTick。
,function am4themes_sdTheme(target) {
if (target instanceof am4core.InterfaceColorSet) {
target.setFor('text',am4core.color('#ffffff')); // text color
target.setFor('grid',am4core.color('#ffffff')); // line color
}
if (target instanceof am4charts.Tick) {
target.strokeOpacity = 1; // line opacity
}
}
am4core.useTheme(am4themes_sdTheme);