mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TimeSeries: Add missing legend width migration (#50551)
This commit is contained in:
parent
fd239f94e8
commit
ce6a73a623
@ -127,6 +127,23 @@ describe('Graph Migrations', () => {
|
||||
panel.options = graphPanelChangedHandler(panel, 'graph', old, prevFieldConfig);
|
||||
expect(panel).toMatchSnapshot();
|
||||
});
|
||||
test('with sideWidth', () => {
|
||||
const old: any = {
|
||||
angular: {
|
||||
legend: {
|
||||
alignAsTable: true,
|
||||
rightSide: true,
|
||||
show: true,
|
||||
sideWidth: 200,
|
||||
total: true,
|
||||
values: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
const panel = {} as PanelModel;
|
||||
panel.options = graphPanelChangedHandler(panel, 'graph', old, prevFieldConfig);
|
||||
expect(panel.options.legend.width).toBe(200);
|
||||
});
|
||||
});
|
||||
|
||||
describe('stacking', () => {
|
||||
|
@ -345,6 +345,10 @@ export function flotToGraphOptions(angular: any): { fieldConfig: FieldConfigSour
|
||||
const enabledLegendValues = pickBy(angular.legend);
|
||||
options.legend.calcs = getReducersFromLegend(enabledLegendValues);
|
||||
}
|
||||
|
||||
if (angular.legend.sideWidth) {
|
||||
options.legend.width = angular.legend.sideWidth;
|
||||
}
|
||||
}
|
||||
|
||||
const tooltipConfig = angular.tooltip;
|
||||
|
Loading…
Reference in New Issue
Block a user