From 0f631ee77dc2ec94ea131256259900451b12f946 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 25 Oct 2017 17:13:02 +0800 Subject: [PATCH] update g2 colors globally --- src/components/Charts/Pie/index.js | 2 +- src/g2.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Charts/Pie/index.js b/src/components/Charts/Pie/index.js index ad2d4e2a..ce5bd308 100644 --- a/src/components/Charts/Pie/index.js +++ b/src/components/Charts/Pie/index.js @@ -64,7 +64,7 @@ class Pie extends Component { lineWidth = 0, } = this.props; - const defaultColors = colors || ['#8543E0', '#F04864', '#FACC14', '#1890FF', '#13C2C2', '#2FC25B']; + const defaultColors = colors; let selected = this.props.selected || true; let tooltip = this.props.tooltips || true; diff --git a/src/g2.js b/src/g2.js index faadc6c3..0ff40f51 100644 --- a/src/g2.js +++ b/src/g2.js @@ -3,9 +3,17 @@ import G2 from 'g2'; G2.track(false); +const colors = [ + '#8543E0', '#F04864', '#FACC14', '#1890FF', '#13C2C2', '#2FC25B', '#fa8c16', '#a0d911', +]; + const config = { ...G2.Theme, defaultColor: '#1089ff', + colors: { + default: colors, + intervalStack: colors, + }, tooltip: { background: { radius: 4, -- GitLab