diff --git a/src/plugins/vis_type_timeseries/public/application/components/timeseries_visualization.tsx b/src/plugins/vis_type_timeseries/public/application/components/timeseries_visualization.tsx index 7fba2e1cb701fc..13d06e1c9a18de 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/timeseries_visualization.tsx +++ b/src/plugins/vis_type_timeseries/public/application/components/timeseries_visualization.tsx @@ -59,22 +59,44 @@ function TimeseriesVisualization({ const indexPatternValue = model.index_pattern || ''; const { indexPatterns } = getDataStart(); const { indexPattern } = await fetchIndexPattern(indexPatternValue, indexPatterns); + let event; + // trigger applyFilter if no index pattern found, url drilldowns are supported only + // for the index pattern mode + if (indexPattern) { + const tables = indexPattern + ? await convertSeriesToDataTable(model, series, indexPattern) + : null; + const table = tables?.[model.series[0].id]; + + const range: [number, number] = [parseInt(gte, 10), parseInt(lte, 10)]; + event = { + data: { + table, + column: X_ACCESSOR_INDEX, + range, + timeFieldName: indexPattern?.timeFieldName, + }, + name: 'brush', + }; + } else { + event = { + name: 'applyFilter', + data: { + timeFieldName: '*', + filters: [ + { + range: { + '*': { + gte, + lte, + }, + }, + }, + ], + }, + }; + } - const tables = indexPattern - ? await convertSeriesToDataTable(model, series, indexPattern) - : null; - const table = tables?.[model.series[0].id]; - - const range: [number, number] = [parseInt(gte, 10), parseInt(lte, 10)]; - const event = { - data: { - table, - column: X_ACCESSOR_INDEX, - range, - timeFieldName: indexPattern?.timeFieldName, - }, - name: 'brush', - }; handlers.event(event); }, [handlers, model]