如何根据 am5charts 地图模板中值的存在来显示或不显示计数?

问题描述 投票:0回答:0

这是模板:

polygonSeries.mapPolygons.template.setAll({
    tooltipText: `{name}
Count: {count}`,
    templateField: 'polygonSettings',
});

这是系列信息。

count
可以有数字,也可以为空。

{    
    id: code,
    polygonSettings: {
        fill: am5.color(amcolors[index]),
    },
    count,
}

现在有没有办法在计数值为空时在悬停中“计数”?

完整代码在这里:https://github.com/ericbrian/coinorganizer/blob/main/app/user/dashboard/page.tsx

谢谢

templates maps amcharts5
© www.soinside.com 2019 - 2024. All rights reserved.