Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css JQV径向量规样式背景_Css_Svg_Gradient_Jqwidget - Fatal编程技术网

Css JQV径向量规样式背景

Css JQV径向量规样式背景,css,svg,gradient,jqwidget,Css,Svg,Gradient,Jqwidget,我正在使用jqwidgets。在这些小部件中,我使用的是径向规。对于那个径向规,我想给径向背景颜色。我有一个类似这样的代码,用于更改径向规中的背景色 $('#gauge').jqxGauge({ style: { fill: '#cccccc', stroke: '#cccccc' }}); 在上面的代码中,我尝试过这样的东西 $('#gauge').jqxGauge({ style: { fill: 'linear-gradient(to top, #000 19%, #000 41%, #

我正在使用jqwidgets。在这些小部件中,我使用的是径向规。对于那个径向规,我想给径向背景颜色。我有一个类似这样的代码,用于更改径向规中的背景色

$('#gauge').jqxGauge({ style: { fill: '#cccccc', stroke: '#cccccc' }});
在上面的代码中,我尝试过这样的东西

$('#gauge').jqxGauge({ style: { fill: 'linear-gradient(to top, #000 19%, #000 41%, #232323 49%, #fff)', stroke: 'linear-gradient(to top, #000 19%, #000 41%, #232323 49%, #fff)' }});
但这不起作用。请帮帮我


谢谢。

我认为CSS渐变不能像SVG填充那样工作

因此,您需要在嵌入页面的SVG中定义渐变。然后你可以参考它们作为你的仪表

因此,例如,填充的等效SVG渐变定义为:

<svg width="0" height="0">
    <defs>
        <linearGradient id="gaugefill" x1="0" y1="1" x2="0" y2="0">
            <stop offset="19%" stop-color="#000"/>
            <stop offset="41%" stop-color="#000"/>
            <stop offset="49%" stop-color="#232323"/>
            <stop offset="100%" stop-color="#fff"/>
        </linearGradient>
    </defs>
</svg>
我将把笔划留给你做

免责声明:我没有使用这些小部件,所以这只是一个有根据的猜测

$('#gauge').jqxGauge({ style: { fill: 'url(#gaugefill)', stroke: '#ccccc` }});