This project is read-only.

Problem adding <radialGradient> to <defs>

Jun 15, 2016 at 8:32 PM
Edited Jun 15, 2016 at 9:07 PM
Hi. I am using the following code to add a radialGradient to <defs>
               SvgRadialGradientServer gradient = new SvgRadialGradientServer()
                {
                    ID = "theGradient" + DateTime.Now.Second.ToString(),
                    CenterX = 50,
                    CenterY = 50,
                    FocalX = 50,
                    FocalY = 50,
                };

                SvgGradientStop outerStop = new SvgGradientStop()
                {
                    Offset = 10,
                    Colour = Color.FromArgb(outerRValue, outerGValue, outerBValue),
                    Opacity = 1
                };

                SvgGradientStop innerStop = new SvgGradientStop()
                {
                    Offset = 10,
                    Colour = Color.FromArgb(innerRValue, innerGValue, innerBValue),
                    Opacity = 1
                };

                gradient.Stops.Add(innerStop);
                gradient.Stops.Add(outerStop);

                SvgDefinitionList definitionList = new SvgDefinitionList();
                definitionList.Children.Add(gradient);
                svgDocument.Children.Add(definitionList);
In the resulting svg, the <defs> and <radialGradient> are added, but the <stop> tags are missing:
<defs>
    <radialGradient cx="50" cy="50" r="50%" fx="50" fy="50" spreadMethod="Pad" gradientUnits="ObjectBoundingBox" id="theGradient31" />
  </defs>
I was expecting to see something more like:
<defs>
    <radialGradient cx="50%" cy="50%" r="50%" fx="50%" fy="50%" spreadMethod="Pad" gradientUnits="ObjectBoundingBox" id="gradRed">
      <stop offset="10%" stop-color="#FDEFEF" stop-opacity="1" />
      <stop offset="100%" stop-color="#FF0000" stop-opacity="1" />
    </radialGradient>
  </defs>
I'd appreciate any input here.

Ed