summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-18 03:08:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-18 03:08:54 +0000
commit5ee120f46740efac7b8a460d7a92e4da82f4fb0b (patch)
treeb44d3bef04e9db472913289e6b53e58a14cb3e61 /app/assets/javascripts
parent72721699f11187199e89631ce0b5e3d2f7c167e9 (diff)
downloadgitlab-ce-5ee120f46740efac7b8a460d7a92e4da82f4fb0b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/monitoring/components/charts/time_series.vue5
-rw-r--r--app/assets/javascripts/monitoring/constants.js7
2 files changed, 10 insertions, 2 deletions
diff --git a/app/assets/javascripts/monitoring/components/charts/time_series.vue b/app/assets/javascripts/monitoring/components/charts/time_series.vue
index eaf0780d9e1..e6dbc38402e 100644
--- a/app/assets/javascripts/monitoring/components/charts/time_series.vue
+++ b/app/assets/javascripts/monitoring/components/charts/time_series.vue
@@ -14,6 +14,7 @@ import {
lineWidths,
symbolSizes,
dateFormats,
+ chartColorValues,
} from '../../constants';
import { makeDataSeries } from '~/helpers/monitor_helper';
import { graphDataValidatorForValues } from '../../utils';
@@ -124,7 +125,7 @@ export default {
// Transforms & supplements query data to render appropriate labels & styles
// Input: [{ queryAttributes1 }, { queryAttributes2 }]
// Output: [{ seriesAttributes1 }, { seriesAttributes2 }]
- return this.graphData.metrics.reduce((acc, query) => {
+ return this.graphData.metrics.reduce((acc, query, i) => {
const { appearance } = query;
const lineType =
appearance && appearance.line && appearance.line.type
@@ -145,7 +146,7 @@ export default {
lineStyle: {
type: lineType,
width: lineWidth,
- color: this.primaryColor,
+ color: chartColorValues[i % chartColorValues.length],
},
showSymbol: false,
areaStyle: this.graphData.type === 'area-chart' ? areaStyle : undefined,
diff --git a/app/assets/javascripts/monitoring/constants.js b/app/assets/javascripts/monitoring/constants.js
index b468254b0cf..ddf6c9878df 100644
--- a/app/assets/javascripts/monitoring/constants.js
+++ b/app/assets/javascripts/monitoring/constants.js
@@ -70,6 +70,13 @@ export const colorValues = {
anomalyAreaColor: '#1f78d1',
};
+export const chartColorValues = [
+ '#1f78d1', // $blue-500 (see variables.scss)
+ '#1aaa55', // $green-500
+ '#fc9403', // $orange-500
+ '#6d49cb', // $purple
+];
+
export const lineTypes = {
default: 'solid',
};