如何将SVG和字体过滤器应用于amcharts4? [英] How to apply SVG and font filters to amcharts4?

查看:120
本文介绍了如何将SVG和字体过滤器应用于amcharts4?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将过滤器应用于我的JS对象,其中<%=strKey%>是动态编写脚本的对象名称,因此,每次迭代时,名称都会更改.

I am trying to apply filters to my JS object, where <%=strKey%> is a dynamically scripted object name, so, each iteration, the name changes.

        // 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格式.我如何将其应用到我的实施中?

The documentation lists JSON format only. How would I apply this to my implementation?

我实际上是想让阴影出现在半圆规的下面.有建议吗?

I'm actually trying to get a shadow to appear under the semi-circular gauge. Suggestions please?

推荐答案

您可以只使用

You can just use a DropShadowFilter to add a shadow to your chart:

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

您可以使用blurdxdy自定义阴影:

You can use blur, dx and dy to customize the shadow:

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

此处是显示该阴影的代码笔.要创建自定义SVG过滤器,您可以遵循此官方教程.

Here is a code pen showing that shadow. To create a custom SVG filter you can follow this official tutorial.

这篇关于如何将SVG和字体过滤器应用于amcharts4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆