Skip to content

Commit

Permalink
Fixed legend label not showing main value for multiple main values
Browse files Browse the repository at this point in the history
  • Loading branch information
Ro4052 authored and Andy Lee committed Feb 15, 2019
1 parent a5c3b89 commit f9be12b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/perspective-viewer-d3fc/src/js/legend/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ export function legend(container, settings, colour) {
getChartElement(this).draw();
});

if (settings.mainValues.length <= 1) {
scrollLegend.labels(options => {
const parts = options.domain[options.i].split("|");
return parts.slice(0, parts.length - 1).join("|");
});
}
scrollLegend.labels(options => {
const parts = options.domain[options.i].split("|");
return settings.mainValues.length <= 1 ? parts.slice(0, parts.length - 1).join("|") : options.domain[options.i];
});

const legendSelection = getOrCreateElement(container, "div.legend-container", () => container.append("div"));

Expand Down

0 comments on commit f9be12b

Please sign in to comment.