BarChart: hide cursor crosshair (#34862)

This commit is contained in:
Leon Sorokin 2021-05-27 23:18:15 -05:00 committed by GitHub
parent e1088e9360
commit 3fd006604f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View File

@ -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 [

View File

@ -353,6 +353,10 @@ export function getConfig(opts: BarsOptions, theme: GrafanaTheme2) {
};
return {
cursor: {
x: false,
y: false,
},
// scale & axis opts
xValues,
xSplits,

View File

@ -75,6 +75,8 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<BarChartOptions> = ({
const config = getConfig(opts, theme);
builder.setCursor(config.cursor);
builder.addHook('init', config.init);
builder.addHook('drawClear', config.drawClear);
builder.addHook('draw', config.draw);