c.createTextNode(regionName);
          textElement.appendChild(textNode);
          pathElement = doc.createElementNS(svg_ns, "path");

          endAngle = startAngle - regionResult * Math.PI * 2 / total;
          dAttribute = "M240,170 L";
          gray =  Math.round(Number(255 * (regionIndex+2)) / (regionCount+2));
          midAngle = (startAngle + endAngle) / 2;
          textElement.setAttributeNS(null, "x", Math.round(240+65*Math.cos(midAngle)));
          textElement.setAttributeNS(null, "y", Mat