title: Compilation errors when drawing a piechart using D3.js, TypeScript and Angular
body: <p>I am trying to display a pie chart and it's actually working, even though I get TypeScript compilation errors: <code>Argument of type '(d: any) =&gt; {}' is not assignable to parameter of type 'datum: Arc&lt;number&gt;, index: number, outerIndex: number) =&gt; number | string | boolean'. Type '{}' is not assignable to type 'number | string | boolean'. Type '{}' is not assignable to type 'boolean'.</code></p>
  
  <p>I've been using TypeScript for the last 2 years, but the line above makes me dizzy. I have no idea what is going on, I tried few things but nothing worked so far.</p>
  
  <p>This is the code that actually draws the pie chart:</p>
  
  <pre><code>function drawChart(){
              var width = 960,
                  height = 500,
                  radius = Math.min(width, height) / 2;
  
              var colourValues = d3.scale.ordinal().range(d3.values(that.ColoursService.colours));
  
              var arc = d3.svg.arc()
                  .outerRadius(radius - 10)
                  .innerRadius(radius - 70);
  
              var pie = d3.layout.pie()
                  .sort(null)
                  .value(function(d: any) {return d.quantity});
  
              var svg = d3.select('.pie-chart').append('svg')
                  .attr('width', width)
                  .attr('height', height)
                  .append('g')
                  .attr('transform', 'translate(' + width / 2 + ',' + height/2 + ')');
  
              var g = svg.selectAll('.arc')
                  .data(pie(data))
                  .enter().append('g')
                  .attr('class', 'arc');
  
              g.append('path')
                  .attr('d', &lt;any&gt;arc)
                  .attr('fill', function(d: any) {
                      return colourValues(d.data.category); 
                  });
          }
  </code></pre>
  
  <p>This is where the typescript highlights the error, the squiggly line appears below "function" word. I need to make the TypeScript compilator pass, but I don't know how.</p>