簡體   English   中英

如何將SVG和字體過濾器應用於amcharts4?

[英]How to apply SVG and font filters to amcharts4?

我正在嘗試將過濾器應用於我的JS對象,其中<%=strKey%>是動態腳本化的對象名稱,因此,每次迭代時,名稱都會更改。

        // dynamically writing JS - key value is the chart name
        var <%=strKey%> = am4core.create("<%=strKey%>", am4charts.GaugeChart);      // has to mach the HTML IDs
        <%=strKey%>.innerRadius = am4core.percent(82);    // innerRadius begins at 82%, leaving white-space inside the gauge

文檔僅列出JSON格式。 我如何將其應用到我的實施中?

我實際上是想讓陰影出現在半圓規下。 建議好嗎?

您可以使用DropShadowFilter為圖表添加陰影:

chart.filters.push(new am4core.DropShadowFilter());

您可以使用blurdxdy來自定義陰影:

var shadow = new am4core.DropShadowFilter();
shadow.blur = 3.5;
shadow.dx = 5;
shadow.dy = 7;
chart.filters.push(shadow);

是顯示該陰影的代碼筆。 要創建自定義SVG過濾器,您可以按照此官方教程進行操作

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM