dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.42k stars 1.81k forks source link

Composite Chart : Be nice to exclude from legend #871

Open LorenzGardner opened 9 years ago

LorenzGardner commented 9 years ago

It would be nice to exclude composed charts from the composite chart legend.

Currently the legend is all or nothing, and there needs to be a way to opt out a graph from the legend.

LorenzGardner commented 9 years ago

A workaround is to override the legendables function of the chart before adding it to the composite chart. This is of course a hack.

var Line = dc.lineChart(theChart) .group(theGroup, "extraLine") .ordinalColors(["#ccc"]); line.legendables = function() { return [];}; //don't return legend data

gordonwoodhull commented 9 years ago

I actually don't think the feature could be much more succinct than your workaround. :-D

There are probably other legend features that we could address at the same time as addressing this, though. For example, #666 filter items in pie chart legend, or maybe #582 hiding series in series chart.