Javascript 图表用图像填充圆圈

Javascript 图表用图像填充圆圈,javascript,charts,amcharts,Javascript,Charts,Amcharts,我正在使用amcharts库制作一个示例。我希望图像填充红色圆圈 这就是我试图做的 icon.circle.strokeWidth = 0; icon.image.properties.width = "100%"; icon.image.properties.height = "100%"; icon.image.properties.maxWidth = "100%"; icon.image.properties.maxHeight = "100%"; 以下是上传到的完

我正在使用amcharts库制作一个示例。我希望图像填充红色圆圈

这就是我试图做的

  icon.circle.strokeWidth = 0;
  icon.image.properties.width = "100%";
  icon.image.properties.height = "100%";
  icon.image.properties.maxWidth = "100%";
  icon.image.properties.maxHeight = "100%";

以下是上传到

的完整代码片段,我声明我不精通amcharts

在你的例子中,我从

icon.circle.radius = am4core.percent(100);
icon.image.properties.scale = 1;

我得到了几乎要求的结果,有一个漂亮的红色边框,将比例增加到3.8左右,图像覆盖了所有的红色表面

它甚至可以不使用

icon.image.properties.width = "100%";
icon.image.properties.height = "100%";
icon.image.properties.maxWidth = "100%";
icon.image.properties.maxHeight = "100%";
可能在你最后应用这个概念的时候,你需要进行更多的计算,以获得我所更改的两个选项所需的比例。。。我不能说

希望能给你一些想法

icon.image.properties.width = "100%";
icon.image.properties.height = "100%";
icon.image.properties.maxWidth = "100%";
icon.image.properties.maxHeight = "100%";