From 4bd34d46be3e5bea5944e572324f363f67cb5d38 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 9 Nov 2019 23:27:44 -0500 Subject: [PATCH] [O] Separate textStyle to GraphUtils --- src/logic/utils/graph-utils.ts | 17 +++++++++++++++++ src/pages/course/type-radar/type-radar.ts | 13 +------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/logic/utils/graph-utils.ts b/src/logic/utils/graph-utils.ts index b2242e2..99bc6fb 100644 --- a/src/logic/utils/graph-utils.ts +++ b/src/logic/utils/graph-utils.ts @@ -70,4 +70,21 @@ export default class GraphUtils ] } } + + /** + * Text style for pie graphs or radar graphs + */ + static pieTextStyle() + { + return { + fontSize: 14, + textShadowColor: '#cfcfcf', + textShadowBlur: 2, + textShadowOffsetX: 1, + textShadowOffsetY: 1, + backgroundColor: '#f6f6f6', + borderRadius: 3, + padding: [3, 5] + } + } } diff --git a/src/pages/course/type-radar/type-radar.ts b/src/pages/course/type-radar/type-radar.ts index 72d1fba..d0faf05 100644 --- a/src/pages/course/type-radar/type-radar.ts +++ b/src/pages/course/type-radar/type-radar.ts @@ -37,18 +37,7 @@ export default class TypeRadar extends Vue // shape: 'circle', name: { - textStyle: - { - fontSize: 14, - textShadowColor: '#cfcfcf', - textShadowBlur: 2, - textShadowOffsetX: 1, - textShadowOffsetY: 1, - color: '#fff', - backgroundColor: '#f6f6f6', - borderRadius: 3, - padding: [3, 5] - } + textStyle: GraphUtils.pieTextStyle() }, splitArea: {