From 3fd006604f365eacf84126cef457cb7d0263e507 Mon Sep 17 00:00:00 2001 From: Leon Sorokin Date: Thu, 27 May 2021 23:18:15 -0500 Subject: [PATCH] BarChart: hide cursor crosshair (#34862) --- .../barchart/__snapshots__/utils.test.ts.snap | 16 ++++++++++++++++ public/app/plugins/panel/barchart/bars.ts | 4 ++++ public/app/plugins/panel/barchart/utils.ts | 2 ++ 3 files changed, 22 insertions(+) diff --git a/public/app/plugins/panel/barchart/__snapshots__/utils.test.ts.snap b/public/app/plugins/panel/barchart/__snapshots__/utils.test.ts.snap index 6332ccd4560..e549b72516b 100644 --- a/public/app/plugins/panel/barchart/__snapshots__/utils.test.ts.snap +++ b/public/app/plugins/panel/barchart/__snapshots__/utils.test.ts.snap @@ -65,6 +65,8 @@ Object { "stroke": [Function], "width": [Function], }, + "x": false, + "y": false, }, "hooks": Object { "draw": Array [ @@ -185,6 +187,8 @@ Object { "stroke": [Function], "width": [Function], }, + "x": false, + "y": false, }, "hooks": Object { "draw": Array [ @@ -305,6 +309,8 @@ Object { "stroke": [Function], "width": [Function], }, + "x": false, + "y": false, }, "hooks": Object { "draw": Array [ @@ -425,6 +431,8 @@ Object { "stroke": [Function], "width": [Function], }, + "x": false, + "y": false, }, "hooks": Object { "draw": Array [ @@ -545,6 +553,8 @@ Object { "stroke": [Function], "width": [Function], }, + "x": false, + "y": false, }, "hooks": Object { "draw": Array [ @@ -665,6 +675,8 @@ Object { "stroke": [Function], "width": [Function], }, + "x": false, + "y": false, }, "hooks": Object { "draw": Array [ @@ -785,6 +797,8 @@ Object { "stroke": [Function], "width": [Function], }, + "x": false, + "y": false, }, "hooks": Object { "draw": Array [ @@ -905,6 +919,8 @@ Object { "stroke": [Function], "width": [Function], }, + "x": false, + "y": false, }, "hooks": Object { "draw": Array [ diff --git a/public/app/plugins/panel/barchart/bars.ts b/public/app/plugins/panel/barchart/bars.ts index f46317efc42..44948594110 100644 --- a/public/app/plugins/panel/barchart/bars.ts +++ b/public/app/plugins/panel/barchart/bars.ts @@ -353,6 +353,10 @@ export function getConfig(opts: BarsOptions, theme: GrafanaTheme2) { }; return { + cursor: { + x: false, + y: false, + }, // scale & axis opts xValues, xSplits, diff --git a/public/app/plugins/panel/barchart/utils.ts b/public/app/plugins/panel/barchart/utils.ts index 12d080ee83b..dc3c3060519 100644 --- a/public/app/plugins/panel/barchart/utils.ts +++ b/public/app/plugins/panel/barchart/utils.ts @@ -75,6 +75,8 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn = ({ const config = getConfig(opts, theme); + builder.setCursor(config.cursor); + builder.addHook('init', config.init); builder.addHook('drawClear', config.drawClear); builder.addHook('draw', config.draw);