How to use the dc.override function in dc

To help you get started, we’ve selected a few dc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NSWSESMembers / Lighthouse / pages / scripts / stats.js View on Github external
.dimension(dimension)
    .group(group);
  chart.legend(dc.legend().legendText(function(d) {
    return d.name + ' (' + d.data + ')';
  }).x(0).y(20))
  chart.on('renderlet', function(chart) {
    chart.selectAll('text.pie-slice')
      .attr('transform', function(d) {
        var translate = d3.select(this).attr('transform');
        var ang = ((d.startAngle + d.endAngle) / 2 * 180 / Math.PI) % 360;
        if (ang < 180) ang -= 90;
        else ang += 90;
        return translate + ' rotate(' + ang + ')';
      });
  });
  dc.override(chart, 'legendables', function() {
    var legendables = this._legendables();
    return legendables.filter(function(l) {
      return l.data > 0;
    });
  });
  return chart;
}

dc

A multi-dimensional charting library built to work natively with crossfilter and rendered using d3.js

Apache-2.0
Latest version published 3 years ago

Package Health Score

62 / 100
Full package analysis