diff --git a/tfjs-vis/src/render/barchart.ts b/tfjs-vis/src/render/barchart.ts index c74dd7c2dd1..3e3f80e972f 100644 --- a/tfjs-vis/src/render/barchart.ts +++ b/tfjs-vis/src/render/barchart.ts @@ -101,7 +101,10 @@ export async function barchart( } }, 'data': {'values': values, 'name': 'values'}, - 'mark': 'bar', + 'mark': { + 'type': 'bar', + 'tooltip': true, + }, 'encoding': { 'x': {'field': 'index', 'type': xType, 'axis': xAxis}, 'y': {'field': 'value', 'type': yType, 'axis': yAxis} @@ -124,8 +127,8 @@ const defaultOpts = { fontSize: 11, }; -// We keep a map of containers to chart instances in order to reuse the instance -// where possible. +// We keep a map of containers to chart instances in order to reuse the +// instance where possible. const instances: Map = new Map(); diff --git a/tfjs-vis/src/render/histogram.ts b/tfjs-vis/src/render/histogram.ts index cfea2f7666b..2096675ce6e 100644 --- a/tfjs-vis/src/render/histogram.ts +++ b/tfjs-vis/src/render/histogram.ts @@ -95,7 +95,10 @@ export async function histogram( 'resize': true, }, 'data': {'values': filtered}, - 'mark': 'bar', + 'mark': { + 'type': 'bar', + 'tooltip': true, + }, 'config': { 'axis': { 'labelFontSize': options.fontSize,