javascript 如何形成一个图标路径,有'填充'选项在角echarts?

zte4gxcn  于 2023-08-02  发布在  Java
关注(0)|答案(1)|浏览(89)

以下是我正在查看的链接:
https://echarts.apache.org/en/option.html#toolbox.feature.dataZoom.icon.zoom
在尝试添加自定义图标到缩放功能时,想知道如何在路径中添加“填充”选项?

<path xmlns="http://www.w3.org/2000/svg" d="M8.67188 3.14062C7.94531 2.46094 6.98438 2.0625 5.97656 2.0625C4.17188 2.08594 2.60156 3.32812 2.17969 5.03906C2.13281 5.17969 2.01562 5.25 1.89844 5.25H0.5625C0.375 5.25 0.234375 5.10938 0.28125 4.92188C0.773438 2.22656 3.14062 0.1875 6 0.1875C7.54688 0.1875 8.95312 0.820312 10.0078 1.80469L10.8516 0.960938C11.2031 0.609375 11.8125 0.867188 11.8125 1.35938V4.5C11.8125 4.82812 11.5547 5.0625 11.25 5.0625H8.08594C7.59375 5.0625 7.33594 4.47656 7.6875 4.125L8.67188 3.14062ZM0.75 6.9375H3.89062C4.38281 6.9375 4.64062 7.54688 4.28906 7.89844L3.30469 8.88281C4.03125 9.5625 4.99219 9.96094 6 9.96094C7.80469 9.9375 9.375 8.69531 9.79688 6.98438C9.84375 6.84375 9.96094 6.77344 10.0781 6.77344H11.4141C11.6016 6.77344 11.7422 6.91406 11.6953 7.10156C11.2031 9.79688 8.83594 11.8125 6 11.8125C4.42969 11.8125 3.02344 11.2031 1.96875 10.2188L1.125 11.0625C0.773438 11.4141 0.1875 11.1562 0.1875 10.6641V7.5C0.1875 7.19531 0.421875 6.9375 0.75 6.9375Z" fill="#C9CFD4"/>

字符串

gcuhipw9

gcuhipw91#

您不能更改路径中的颜色,但通过iconStyle属性。

dataZoom: {
    iconStyle: {
        color: 'grey',        // corresponds to the fill color
        borderColor: 'red',   // corresponds to the line color
    }
}

字符串
这是一个小example

相关问题