As per José's suggestion, it would be great to provide a facility to filter legend items in charts, for example, based on a max/min/thresholds in the series data. This is currently not support but can be easily added, e.g.:
joint.shapes.chart.PlotView.prototype.updateLegend = function() {
var series = this.model.get('series');
this.elLegendItems.textContent = '';
var dy = 0;
_.each(series, function(serie, i) {
// An example of skipping a legend item if max value of
// a serie is less than 6.
if (this.stats.bySerie[serie.name || i].maxY < 6) {
return;
}
var elLegendItem = this.elLegendItem.clone();
if (_.contains(this._disabledSeries, serie.name)) {
elLegendItem.addClass('disabled');
}
elLegendItem.attr('data-serie', serie.name);
elLegendItem.findOne('circle').attr({ fill: this.getSerieColor(serie.name) });
elLegendItem.findOne('text').text(serie.label || serie.name);
elLegendItem.translate(0, dy);
V(this.elLegendItems).append(elLegendItem);
dy += 16; // legend item line-height
}, this);
};
As per José's suggestion, it would be great to provide a facility to filter legend items in charts, for example, based on a max/min/thresholds in the series data. This is currently not support but can be easily added, e.g.: