-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Metrics][Discover] Discover to prefer line chars for time series data #244595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
f401420
4c88e52
9a1c9c0
1e065cc
b7fce59
f0fb456
6b9498e
eae22ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ import { | |
| hasTransformationalCommand, | ||
| getCategorizeField, | ||
| convertTimeseriesCommandToFrom, | ||
| hasTimeseriesBucketAggregation, | ||
| } from '@kbn/esql-utils'; | ||
| import type { DataView, DataViewField } from '@kbn/data-views-plugin/common'; | ||
| import type { | ||
|
|
@@ -657,10 +658,15 @@ export class LensVisService { | |
| return []; | ||
| } | ||
|
|
||
| const preferredChartType = preferredVisAttributes | ||
| const mappedPreferredChartType = preferredVisAttributes | ||
| ? mapVisToChartType(preferredVisAttributes.visualizationType) | ||
| : undefined; | ||
|
|
||
| const preferredChartType = | ||
| !mappedPreferredChartType && hasTimeseriesBucketAggregation(query.esql, columns) | ||
| ? ChartType.Line | ||
| : mappedPreferredChartType; | ||
|
Comment on lines
+665
to
+668
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we'd add a test case for this to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks. I'll add a test case there
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| let visAttributes = preferredVisAttributes; | ||
|
|
||
| if (preferredVisAttributes) { | ||
|
|
@@ -671,7 +677,7 @@ export class LensVisService { | |
| dataViewSpec: dataView?.toSpec(), | ||
| fieldName: '', | ||
| textBasedColumns: columns, | ||
| query: query && isOfAggregateQueryType(query) ? query : undefined, | ||
| query, | ||
| }; | ||
|
|
||
| return ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.