I have a column chart in AmCharts 5 and i want to make some of the columns have a striped pattern based on some condition. I tried using template adapters but it doesn't seem to work.
series.columns.template.adapters.add("fillPattern", (pattern, target) => {
const dataItem: any = target.dataItem;
if (dataItem) {
if (SOME_CONDITION) {
return am5.LinePattern.new(root, {
color: am5.color(COLORS.WHITE),
rotation: 45,
width: 200,
height: 200,
});
}
}
// Return undefined for columns that shouldn't have a pattern
return undefined;
});
In the documentation series.columns.template.set("fillPattern", somePattern) is used but this one add pattern to the whole series. I also don't want to have multiple series to set pattern for some of them. How can I achieve my goal?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744147408a4560488.html
评论列表(0条)