diff options
3 files changed, 8 insertions, 4 deletions
diff --git a/app/assets/javascripts/monitoring/components/charts/area.vue b/app/assets/javascripts/monitoring/components/charts/area.vue index 14c02db7bcc..9e031b03579 100644 --- a/app/assets/javascripts/monitoring/components/charts/area.vue +++ b/app/assets/javascripts/monitoring/components/charts/area.vue @@ -139,8 +139,7 @@ export default { return this.graphData.queries.map(query => query.label).join(', '); }, yAxisLabel() { - const [query] = this.graphData.queries; - return `${this.graphData.y_label} (${query.unit})`; + return `${this.graphData.y_label}`; }, }, watch: { diff --git a/changelogs/unreleased/56477-units-are-appended-to-y-axis-label-on-metrics-dashboard.yml b/changelogs/unreleased/56477-units-are-appended-to-y-axis-label-on-metrics-dashboard.yml new file mode 100644 index 00000000000..7febe175faf --- /dev/null +++ b/changelogs/unreleased/56477-units-are-appended-to-y-axis-label-on-metrics-dashboard.yml @@ -0,0 +1,5 @@ +--- +title: Remove duplicate units from metrics graph +merge_request: 25485 +author: +type: fixed diff --git a/spec/javascripts/monitoring/charts/area_spec.js b/spec/javascripts/monitoring/charts/area_spec.js index 0b36fc9f5f7..d334ef7ba4f 100644 --- a/spec/javascripts/monitoring/charts/area_spec.js +++ b/spec/javascripts/monitoring/charts/area_spec.js @@ -127,7 +127,7 @@ describe('Area component', () => { }); it('formats tooltip content', () => { - expect(areaChart.vm.tooltip.content).toBe('CPU (Cores) 5.556'); + expect(areaChart.vm.tooltip.content).toBe('CPU 5.556'); }); }); @@ -213,7 +213,7 @@ describe('Area component', () => { describe('yAxisLabel', () => { it('constructs a label for the chart y-axis', () => { - expect(areaChart.vm.yAxisLabel).toBe('CPU (Cores)'); + expect(areaChart.vm.yAxisLabel).toBe('CPU'); }); }); }); |