title: Trouble drawing a pie chart with SVG
body: <p>I'm working in a SVG small system to draw charts (line, bar and pie) and I'm having some weird issues with the pie chart... When the sections in the chart are smaller than the half of the circle, the function works perfectly and everything gets drawn correctly (see the image below):</p>
  
  <p><img src="https://i.stack.imgur.com/FPYD1.png" alt="enter image description here"></p>
  
  <p>However, when a portion of the pie is bigger than the half of the circle, the portion is drawn wrong, as if the center of the arc was moved (see the image below and note that the red part is the "empty" circle where the portions have to be drawn: I'm filling it with red color to check if portions are drawn correcly or not):</p>
  
  <p><img src="https://i.stack.imgur.com/Nl1vZ.png" alt="enter image description here"></p>
  
  <p>I'm using SVG's "path" function with absolute parameters to draw each pie portion. I'm passing some parameters to the function:</p>
  
  <p>$circleCenter_ corresponds to the X and Y position of the center of the circle.
  $valPos[i][0-1] contains the X and Y position of each point of the triangle formed by the center and the two points on the circle (where the portion should end).</p>
  
  <p>Here is the "path" I'm using:</p>
  
  <pre><code>&lt;path d="M&lt;?php echo $circleCenterX." ".$circleCenterY; ?&gt; 
  L&lt;?php echo $valPos[$i][0][0].",".$valPos[$i][0][1] ?&gt; 
  A&lt;?php echo $circleRadius.",".$circleRadius; ?&gt; 0 0,1 &lt;?php echo $valPos[$i][1][0].",".$valPos[$i][1][1]; ?&gt; Z" 
  (...) /&gt;
  </code></pre>
  
  <p>I don't understand why it works fine when the portion is less than the circle half, and why it seems like the center is "moved" when the portion is bigger than the circle half. Of course the $circleCenter variables are never modified inside the pie drawing function...</p>
  
  <p>Any clue about this?</p>
  
  <p>Thanks in advance for your time and effort! :)</p>