F
Filament4w ago
taz

ChartJS custom tooltip positioner

To add a plugin to chartjs as Filament docs say I use the filamentChartJsPlugins array. Id like also to register a cutsom positioner for the tooltip. As chartJS doc I must hook into Tooltip object. Is that possible to do this with Filament ? ChartJS doc example to add a custom positoner:
import { Tooltip } from 'chart.js';

Tooltip.positioners.myCustomPositioner = function(elements, eventPosition) {
import { Tooltip } from 'chart.js';

Tooltip.positioners.myCustomPositioner = function(elements, eventPosition) {
filament-chart-js-plugin.js
import crosshairPlugin from 'chartjs-plugin-crosshair'

window.filamentChartJsPlugins ??= []
window.filamentChartJsPlugins.push(crosshairPlugin)
import crosshairPlugin from 'chartjs-plugin-crosshair'

window.filamentChartJsPlugins ??= []
window.filamentChartJsPlugins.push(crosshairPlugin)
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?