diff --git a/src/components/figures/chart/chartJs/chartjs.ts b/src/components/figures/chart/chartJs/chartjs.ts index 3e6ff85010..d1a374f6a4 100644 --- a/src/components/figures/chart/chartJs/chartjs.ts +++ b/src/components/figures/chart/chartJs/chartjs.ts @@ -21,6 +21,7 @@ import { chartShowValuesPlugin } from "./chartjs_show_values_plugin"; import { sunburstHoverPlugin } from "./chartjs_sunburst_hover_plugin"; import { sunburstLabelsPlugin } from "./chartjs_sunburst_labels_plugin"; import { waterfallLinesPlugin } from "./chartjs_waterfall_plugin"; +import { zoomWindowPlugin } from "./zoomable_chart/zoomable_chartjs_plugins"; interface Props { chartId: UID; @@ -64,6 +65,10 @@ chartJsExtensionRegistry.add("calendarController", { register: (Chart) => Chart.register(getCalendarChartController()), unregister: (Chart) => Chart.unregister(getCalendarChartController()), }); +chartJsExtensionRegistry.add("zoomWindowPlugin", { + register: (Chart) => Chart.register(zoomWindowPlugin), + unregister: (Chart) => Chart.unregister(zoomWindowPlugin), +}); export class ChartJsComponent extends Component { static template = "o-spreadsheet-ChartJsComponent"; diff --git a/src/components/figures/chart/chartJs/zoomable_chart/zoomable_chartjs.ts b/src/components/figures/chart/chartJs/zoomable_chart/zoomable_chartjs.ts index 18e0e3155d..47aef4b62a 100644 --- a/src/components/figures/chart/chartJs/zoomable_chart/zoomable_chartjs.ts +++ b/src/components/figures/chart/chartJs/zoomable_chart/zoomable_chartjs.ts @@ -5,19 +5,12 @@ import { } from "@odoo/o-spreadsheet-engine/helpers/figures/charts/chart_common"; import { useRef } from "@odoo/owl"; import { Chart, ChartConfiguration } from "chart.js/auto"; -import { chartJsExtensionRegistry } from "../../../../../../packages/o-spreadsheet-engine/src/helpers/figures/charts/chart_js_extension"; import { clip } from "../../../../../helpers"; import { Store, useStore } from "../../../../../store_engine"; import { ChartJSRuntime } from "../../../../../types"; import { withZoom } from "../../../../helpers/zoom"; import { ChartJsComponent } from "../chartjs"; import { Boundaries, ZoomableChartStore } from "./zoomable_chart_store"; -import { zoomWindowPlugin } from "./zoomable_chartjs_plugins"; - -chartJsExtensionRegistry.add("zoomWindowPlugin", { - register: (Chart) => Chart.register(zoomWindowPlugin), - unregister: (Chart) => Chart.unregister(zoomWindowPlugin), -}); export class ZoomableChartJsComponent extends ChartJsComponent { static template = "o-spreadsheet-ZoomableChartJsComponent";