mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TimeSeries: Add support for negative Y and constant transform (#44774)
* add negative y config
* Handle negative y and constant transform in Timeseries panel
* Typechecks
* Add migration from old graph panel
* Docs update
* Revert "Add migration from old graph panel"
This reverts commit 33b5a90b66.
* Revert VizLegendItem changes
* Automatically separate positive and negative stacks within a group
* Update packages/grafana-ui/src/components/VizLegend/VizLegend.story.tsx
* Remove SeriesLabel component
* Update docs/sources/visualizations/time-series/_index.md
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* Update docs/sources/visualizations/time-series/_index.md
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* Leftover reverts
* Don't crate bands (for now0 for negative -y stack
* Add docs note about transform being only available as an override
* Fill negative bands in reversed direction
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
VisibilityMode,
|
||||
StackingMode,
|
||||
GraphTresholdsStyleMode,
|
||||
GraphTransform,
|
||||
} from '@grafana/schema';
|
||||
|
||||
import { graphFieldOptions, commonOptionsBuilder } from '@grafana/ui';
|
||||
@@ -181,6 +182,29 @@ export function getGraphFieldConfig(cfg: GraphFieldConfig): SetFieldConfigOption
|
||||
});
|
||||
|
||||
commonOptionsBuilder.addStackingConfig(builder, cfg.stacking, categoryStyles);
|
||||
|
||||
builder.addSelect({
|
||||
category: categoryStyles,
|
||||
name: 'Transform',
|
||||
path: 'transform',
|
||||
settings: {
|
||||
options: [
|
||||
{
|
||||
label: 'Constant',
|
||||
value: GraphTransform.Constant,
|
||||
description: 'The first value will be shown as a constant line',
|
||||
},
|
||||
{
|
||||
label: 'Negative Y',
|
||||
value: GraphTransform.NegativeY,
|
||||
description: 'Flip the results to negative values on the y axis',
|
||||
},
|
||||
],
|
||||
isClearable: true,
|
||||
},
|
||||
hideFromDefaults: true,
|
||||
});
|
||||
|
||||
commonOptionsBuilder.addAxisConfig(builder, cfg);
|
||||
commonOptionsBuilder.addHideFrom(builder);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user