Skip to content

Commit

Permalink
fix: fix error of gradient in areachart, fix #3624
Browse files Browse the repository at this point in the history
  • Loading branch information
xile611 committed Jan 7, 2025
1 parent 991167d commit d1d6bf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export class DomTooltipHandler extends BaseTooltipHandler {
styleByRow = { ...styleByRow, ...getTextStyle(entry.valueStyle) };
}
} else if (colName === 'shape') {
row.innerHTML = getSvgHtml(entry);
row.innerHTML = getSvgHtml(entry, `${this.id}_${index}`);
}

setStyleToDom(row, styleByRow);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Symbol } from '@visactor/vrender-core';
import { Bounds, isObject, isString } from '@visactor/vutils';
import type { ITooltipShapeActual } from '../../../../typings';

export function getSvgHtml(option: ITooltipShapeActual | undefined, index?: number) {
export function getSvgHtml(option: ITooltipShapeActual | undefined, gradientId?: string) {
if (!option || !option.hasShape || !option.shapeType) {
return '';
}
Expand Down Expand Up @@ -61,7 +61,7 @@ export function getSvgHtml(option: ITooltipShapeActual | undefined, index?: numb
</svg>`;
}
if (isObject(shapeFill)) {
fillString = 'gradientColor' + (index ?? '');
fillString = 'gradientColor' + (gradientId ?? '');
let gradient = '';
const stops = ((shapeFill as IGradientColor).stops ?? [])
.map(s => `<stop offset="${escapeHTML(s.offset.toString())}" stop-color="${escapeHTML(s.color)}"/>`)
Expand Down

0 comments on commit d1d6bf2

Please sign in to comment.