|
|
|
@ -1,6 +1,7 @@ |
|
|
|
import { getTooltipPositionerMapTop } from '@ghostfolio/common/chart-helper'; |
|
|
|
|
|
|
|
import { Tooltip, TooltipPositionerFunction, ChartType } from 'chart.js'; |
|
|
|
import { Chart, Tooltip, TooltipPositionerFunction, ChartType } from 'chart.js'; |
|
|
|
import annotationPlugin from 'chartjs-plugin-annotation'; |
|
|
|
|
|
|
|
interface VerticalHoverLinePluginOptions { |
|
|
|
color?: string; |
|
|
|
@ -23,6 +24,10 @@ export function registerChartConfiguration() { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// Register the annotation plugin early so that every chart is initialized
|
|
|
|
// with its state and does not crash on interaction
|
|
|
|
Chart.register(annotationPlugin); |
|
|
|
|
|
|
|
Tooltip.positioners.top = function (_elements, eventPosition) { |
|
|
|
return getTooltipPositionerMapTop(this.chart, eventPosition); |
|
|
|
}; |
|
|
|
|