简体   繁体   中英

SVG filter def not working on IE11

I have a svg element on my page and have created a definition to contain a filter specifying a drop-shadow effect

The effects work perfectly on Chrome and Firefox but IE11 is not rendering the effects.

 <svg class="historicUploadDonuts" width="254.375" height="254.375" filter="url(&quot;#ieDropShadow0&quot;)"> <defs> <filter id="ieDropShadow0" height="130%"> <feGaussianBlur in="SourceAlpha" stdDeviation="3" result="blur"></feGaussianBlur> <feOffset in="blur" result="offsetBlur" dx="3" dy="3"></feOffset> <feMerge> <feMergeNode></feMergeNode> <feMergeNode in="SourceGraphic"></feMergeNode> </feMerge> </filter> </defs> <g class="slices" transform="translate(117.1875,117.1875)"> <g class="labelName"> <circle class="cleanCircle" fill="none" r="58.59375"></circle> <text class="cleanText" fill="#000" style="font-size: 11.7188px; text-anchor: middle;" font-weight="bold"></text> </g> <path class="chart-no-data" stroke="0" d="M5.740531871003218e-15,-93.75A93.75,93.75,0,0,1,93.75,0L58.59375,0A58.59375,58.59375,0,0,0,3.5878324193770114e-15,-58.59375Z"></path> <path class="chart-no-data" stroke="0" d="M93.75,0A93.75,93.75,0,0,1,5.740531871003218e-15,93.75L3.5878324193770114e-15,58.59375A58.59375,58.59375,0,0,0,58.59375,0Z"></path> <path class="chart-no-data" stroke="0" d="M5.740531871003218e-15,93.75A93.75,93.75,0,0,1,-93.75,1.1481063742006436e-14L-58.59375,7.175664838754023e-15A58.59375,58.59375,0,0,0,3.5878324193770114e-15,58.59375Z"></path> <path class="chart-no-data" stroke="0" d="M-93.75,1.1481063742006436e-14A93.75,93.75,0,0,1,-1.7221595613009652e-14,-93.75L-1.0763497258131033e-14,-58.59375A58.59375,58.59375,0,0,0,-58.59375,7.175664838754023e-15Z"></path> </g> </svg> 

I followed the example here - http://xn--dahlstrm-t4a.net/svg/filters/arrow-with-dropshadow.svg - but cannot get the effects to work on IE11

The example which works uses a polygon - is there a reason why the svg I am using is NOT picking up the filter ieDropShadow0 ?

Set the filter on the outermost g.slices element. Leave off the inner quotes.

 <svg class="historicUploadDonuts" width="254.375" height="254.375"> <defs> <filter id="ieDropShadow0" height="130%"> <feGaussianBlur in="SourceAlpha" stdDeviation="3" result="blur"></feGaussianBlur> <feOffset in="blur" result="offsetBlur" dx="3" dy="3"></feOffset> <feMerge> <feMergeNode></feMergeNode> <feMergeNode in="SourceGraphic"></feMergeNode> </feMerge> </filter> </defs> <g class="slices" filter="url(#ieDropShadow0)" transform="translate(117.1875,117.1875)"> <g class="labelName"> <circle class="cleanCircle" fill="none" r="58.59375"></circle> <text class="cleanText" fill="#000" style="font-size: 11.7188px; text-anchor: middle;" font-weight="bold"></text> </g> <path class="chart-no-data" stroke="0" d="M5.740531871003218e-15,-93.75A93.75,93.75,0,0,1,93.75,0L58.59375,0A58.59375,58.59375,0,0,0,3.5878324193770114e-15,-58.59375Z"></path> <path class="chart-no-data" stroke="0" d="M93.75,0A93.75,93.75,0,0,1,5.740531871003218e-15,93.75L3.5878324193770114e-15,58.59375A58.59375,58.59375,0,0,0,58.59375,0Z"></path> <path class="chart-no-data" stroke="0" d="M5.740531871003218e-15,93.75A93.75,93.75,0,0,1,-93.75,1.1481063742006436e-14L-58.59375,7.175664838754023e-15A58.59375,58.59375,0,0,0,3.5878324193770114e-15,58.59375Z"></path> <path class="chart-no-data" stroke="0" d="M-93.75,1.1481063742006436e-14A93.75,93.75,0,0,1,-1.7221595613009652e-14,-93.75L-1.0763497258131033e-14,-58.59375A58.59375,58.59375,0,0,0,-58.59375,7.175664838754023e-15Z"></path> </g> </svg> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM