Added Charts
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { ref } from 'vue'
|
||||
|
||||
export function useChartTooltip<T>() {
|
||||
const tooltipItem = ref<T | null>(null)
|
||||
const tooltipX = ref(0)
|
||||
const tooltipY = ref(0)
|
||||
|
||||
const onMouseMove = (e: MouseEvent) => {
|
||||
tooltipX.value = e.clientX + 14
|
||||
tooltipY.value = e.clientY + 14
|
||||
}
|
||||
|
||||
const onMouseLeave = () => {
|
||||
tooltipItem.value = null
|
||||
}
|
||||
|
||||
return { tooltipItem, tooltipX, tooltipY, onMouseMove, onMouseLeave }
|
||||
}
|
||||
Reference in New Issue
Block a user