-
Notifications
You must be signed in to change notification settings - Fork 61
[ENHANCEMENT] timeserieschart: add per-query stack override #670
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 all commits
5a8f3c4
25b27cf
010cbca
f694f67
64c38af
a5810e4
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 |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ import { | |
| EChartsValues, | ||
| TimeSeriesOption, | ||
| StepOptions, | ||
| getCommonTimeScale, | ||
| getCommonTimeScale | ||
| } from '@perses-dev/components'; | ||
| import { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system'; | ||
| import { TimeScale, TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '@perses-dev/spec'; | ||
|
|
@@ -69,11 +69,13 @@ export function getTimeSeries( | |
| visual: TimeSeriesChartVisualOptions, | ||
| timeScale: TimeScale, | ||
| paletteColor: string, | ||
| querySettings?: { lineStyle?: LineStyleType; areaOpacity?: number }, | ||
| querySettings?: { lineStyle?: LineStyleType; areaOpacity?: number; stack?: boolean }, | ||
| yAxisIndex?: number | ||
| ): TimeSeriesOption { | ||
| const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH; | ||
| const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS; | ||
| const shouldStack = | ||
| querySettings?.stack !== undefined ? querySettings.stack : visual.stack === 'all'; | ||
|
|
||
|
SoWieMarkus marked this conversation as resolved.
|
||
| // Shows datapoint symbols when selected time range is roughly 15 minutes or less | ||
| const minuteMs = 60000; | ||
|
|
@@ -90,7 +92,7 @@ export function getTimeSeries( | |
| datasetIndex, | ||
| name: formattedName, | ||
| color: paletteColor, | ||
| stack: visual.stack === 'all' ? visual.stack : undefined, | ||
| stack: shouldStack ? 'all' : undefined, | ||
| yAxisIndex: yAxisIndex, | ||
|
Comment on lines
75
to
96
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. @SoWieMarkus, I can also confirm that the tooltip is not working anymore when it is stacked after your changes. I tested manually.
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. Can you explain what exactly is not working anymore? I know there are issues with the tooltip when stacking is enabled, but that an issue that was there before my change. |
||
| label: { | ||
| show: false, | ||
|
|
@@ -106,7 +108,7 @@ export function getTimeSeries( | |
| name: formattedName, | ||
| connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS, | ||
| color: paletteColor, | ||
| stack: visual.stack === 'all' ? visual.stack : undefined, | ||
| stack: shouldStack ? 'all' : undefined, | ||
| yAxisIndex: yAxisIndex, | ||
| sampling: 'lttb', | ||
| progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT, // https://echarts.apache.org/en/option.html#series-lines.progressiveThreshold | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.