Skip to content

Commit

Permalink
fix(tooltip-#1448):Issue with numeric value in tooltip when truncatio…
Browse files Browse the repository at this point in the history
…n type set to none (#1667)
  • Loading branch information
RiyaJethwa authored Oct 6, 2023
1 parent 9f2604f commit c68e35a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/core/src/components/essentials/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,14 @@ export class Tooltip extends Component {
item.value = truncateLabel(item.value, truncationType, truncationNumCharacter)
}

return item
})
} else {
return items.map((item: any) => {
item.value = item.value ? this.valueFormatter(item.value, item.label) : item.value
return item
})
}

return items
}

getTooltipHTML(formattedItems: any) {
Expand Down Expand Up @@ -192,10 +195,10 @@ export class Tooltip extends Component {

return value.toLocaleString()
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unused-vars

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unused-vars
render(animate = false) {
const options = this.getOptions()
const isTooltipEnabled = getProperty(options, 'tooltip', 'enabled')
Expand Down Expand Up @@ -229,7 +232,9 @@ export class Tooltip extends Component {
if (!mouseRelativePos) {
mouseRelativePos = pointer(getProperty(e, 'detail', 'event'), holder)
} else {
const zoombarType = getProperty(options, 'zoomBar', 'top', 'type') as 'graph_view' | 'slider_view'
const zoombarType = getProperty(options, 'zoomBar', 'top', 'type') as
| 'graph_view'
| 'slider_view'
const zoombarHeight = zoomBarConfigs.height[zoombarType]

// if the mouse position is from event (ruler)
Expand Down

0 comments on commit c68e35a

Please sign in to comment.