diff --git a/public/index.html b/public/index.html index 2978fdf6a718fbec8b2102b2fb99d9c2f899b9c2..358e7d9520d8ffe0c633e3bda83158503e1b48d2 100755 --- a/public/index.html +++ b/public/index.html @@ -4,7 +4,7 @@ Ant Design Pro - + diff --git a/src/g2.js b/src/g2.js new file mode 100644 index 0000000000000000000000000000000000000000..faadc6c357e234825f2f2248baf552042c74b578 --- /dev/null +++ b/src/g2.js @@ -0,0 +1,18 @@ +// 全局 G2 设置 +import G2 from 'g2'; + +G2.track(false); + +const config = { + ...G2.Theme, + defaultColor: '#1089ff', + tooltip: { + background: { + radius: 4, + fill: '#000', + fillOpacity: 0.75, + }, + }, +}; + +G2.Global.setTheme(config); diff --git a/src/index.js b/src/index.js index ae0c9dbf9425b36325b17c66ef2bfcabe14b06af..88dbc389423f69dc80533adc6d43292be9bb82c5 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,10 @@ import dva from 'dva'; -import G2 from 'g2'; import 'moment/locale/zh-cn'; import models from './models'; +import './g2'; // import { browserHistory } from 'dva/router'; import './index.less'; -G2.track(false); - // 1. Initialize const app = dva({ // history: browserHistory,