Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: fix style of dom tooltip\n\n",
"type": "none",
"packageName": "@visactor/vchart"
}
],
"packageName": "@visactor/vchart",
"email": "dingling112@gmail.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export class DomTooltipHandler extends BaseTooltipHandler {

if (contentDom && hasContent) {
const columnDivs = [...(contentDom.children as any)] as HTMLElement[];
setStyleToDom(contentDom, { whiteSpace: 'nowrap' });

columnDivs.forEach((colDiv, index) => {
const colName = colDiv.getAttribute('data-col');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const getScale = (element: HTMLElement, boundingClientRect?: DOMRect) =>
if (element.offsetWidth > 0) {
return boundingClientRect.width / element.offsetWidth;
}
return boundingClientRect.height / element.offsetHeight;
return element.offsetHeight > 0 ? boundingClientRect.height / element.offsetHeight : 1;
};

export const formatContent = (content: any) => {
Expand Down
Loading