diff --git a/src/plugins/vis_type_timeseries/public/application/components/panel_config/timeseries.js b/src/plugins/vis_type_timeseries/public/application/components/panel_config/timeseries.js
index 0b8b4be67b7a0e..30bc60cbce79d3 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/panel_config/timeseries.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/panel_config/timeseries.js
@@ -61,6 +61,7 @@ class TimeseriesPanelConfigUi extends Component {
axis_min: '',
legend_position: 'right',
show_grid: 1,
+ tooltip_mode: 'show_all',
};
const model = { ...defaults, ...this.props.model };
const { selectedTab } = this.state;
@@ -85,6 +86,22 @@ class TimeseriesPanelConfigUi extends Component {
value: 'left',
},
];
+ const tooltipModeOptions = [
+ {
+ label: intl.formatMessage({
+ id: 'visTypeTimeseries.timeseries.tooltipOptions.showAll',
+ defaultMessage: 'Show all values',
+ }),
+ value: 'show_all',
+ },
+ {
+ label: intl.formatMessage({
+ id: 'visTypeTimeseries.timeseries.tooltipOptions.showFocused',
+ defaultMessage: 'Show single value',
+ }),
+ value: 'show_focused',
+ },
+ ];
const selectedPositionOption = positionOptions.find((option) => {
return model.axis_position === option.value;
});
@@ -134,6 +151,10 @@ class TimeseriesPanelConfigUi extends Component {
return model.legend_position === option.value;
});
+ const selectedTooltipMode = tooltipModeOptions.find((option) => {
+ return model.tooltip_mode === option.value;
+ });
+
let view;
if (selectedTab === 'data') {
view = (
@@ -356,6 +377,24 @@ class TimeseriesPanelConfigUi extends Component {
+
+
+
+
+
+
+
+
diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js
index b4c563f3c11fd3..ddfaf3c1428d9c 100644
--- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js
+++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js
@@ -250,6 +250,7 @@ export class TimeseriesVisualization extends Component {
showGrid={Boolean(model.show_grid)}
legend={Boolean(model.show_legend)}
legendPosition={model.legend_position}
+ tooltipMode={model.tooltip_mode}
xAxisLabel={getAxisLabelString(interval)}
xAxisFormatter={this.xAxisFormatter(interval)}
annotations={this.prepareAnnotations()}
diff --git a/src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js b/src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js
index 274b46bce27155..a4f48bc89ae1de 100644
--- a/src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js
+++ b/src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js
@@ -61,6 +61,7 @@ export const TimeSeries = ({
showGrid,
legend,
legendPosition,
+ tooltipMode,
xAxisLabel,
series,
yAxis,
@@ -131,7 +132,7 @@ export const TimeSeries = ({
baseTheme={theme}
tooltip={{
snap: true,
- type: TooltipType.VerticalCursor,
+ type: tooltipMode === 'show_all' ? TooltipType.VerticalCursor : TooltipType.Follow,
headerFormatter: tooltipFormatter,
}}
/>