Reputation: 36
Need to change line(grid) color, create custom theme, but my line with opacity
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);
Thanks!
Upvotes: 0
Views: 454
Reputation: 36
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);
Upvotes: 0
Reputation: 16012
That's a tick, not a grid. You have to target it separately:
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 extends different types of elements, so you might want to be more specific and use PieTick if you want to differentiate between pie ticks, axis ticks, etc.
Upvotes: 1