Skip to content

Commit da4c9f4

Browse files
icaro1508Ícaro Aguiar Perez
and
Ícaro Aguiar Perez
authored
fix(core): fix Legend and Tooltip group color (#834)
* fix(core): fix Legend and Tooltip group color Fix Legend and Tooltip Group colors to be based on the getFillColor option as well fix #828 * fix(core): make color of legend and tooltip group be based on element's fillColor Reverts 6fb39af and changes the color used in the Legend and Tooltip group item to use the element's fillColor instead of the strokeColor fix #828 Co-authored-by: Ícaro Aguiar Perez <[email protected]>
1 parent 23a9788 commit da4c9f4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: packages/core/src/components/essentials/legend.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Legend extends Component {
8282
.attr("ry", 1)
8383
.style("fill", (d) => {
8484
return d.status === Configuration.legend.items.status.ACTIVE
85-
? this.model.getStrokeColor(d.name)
85+
? this.model.getFillColor(d.name)
8686
: null;
8787
})
8888
.classed("active", function (d, i) {
@@ -231,8 +231,8 @@ export class Legend extends Component {
231231

232232
if (
233233
startingPoint +
234-
spaceNeededForCheckbox +
235-
legendItemTextDimensions.width >
234+
spaceNeededForCheckbox +
235+
legendItemTextDimensions.width >
236236
svgDimensions.width
237237
) {
238238
lineNumber++;

Diff for: packages/core/src/components/essentials/tooltip-axis.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class AxisChartsTooltip extends Tooltip {
7878
{
7979
label: options.tooltip.groupLabel || "Group",
8080
value: datum[groupMapsTo],
81-
color: this.model.getStrokeColor(datum[groupMapsTo])
81+
color: this.model.getFillColor(datum[groupMapsTo])
8282
}
8383
];
8484
} else if (data.length > 1) {
@@ -94,7 +94,7 @@ export class AxisChartsTooltip extends Tooltip {
9494
.map((datum) => ({
9595
label: datum[groupMapsTo],
9696
value: this.valueFormatter(datum[rangeIdentifier]),
97-
color: this.model.getStrokeColor(datum[groupMapsTo])
97+
color: this.model.getFillColor(datum[groupMapsTo])
9898
}))
9999
.sort((a, b) => b.value - a.value)
100100
);

0 commit comments

Comments
 (0)