ソースを参照

fixed charts colors & import default g2 config in charts (#567)

niko 8 年 前
コミット
013247c6a8

+ 10 - 1
src/components/Charts/TagCloud/index.js

@@ -131,7 +131,16 @@ class TagCloud extends Component {
         ref={this.saveRootRef}
       >
         {dv && (
-          <Chart width={w} height={h} data={dv} padding={0}>
+          <Chart
+            width={w}
+            height={h}
+            data={dv}
+            padding={0}
+            scale={{
+              x: { nice: false },
+              y: { nice: false },
+            }}
+          >
             <Coord reflect="y" />
             <Geom type="point" position="x*y" color="text" shape="cloud" />
           </Chart>

src/g2.js → src/components/Charts/g2.js


+ 1 - 0
src/components/Charts/index.js

@@ -1,4 +1,5 @@
 import numeral from 'numeral';
+import './g2';
 import ChartCard from './ChartCard';
 import Bar from './Bar';
 import Pie from './Pie';

+ 0 - 1
src/index.js

@@ -2,7 +2,6 @@ import '@babel/polyfill';
 import dva from 'dva';
 import 'moment/locale/zh-cn';
 import FastClick from 'fastclick';
-import './g2';
 import './rollbar';
 import onError from './error';
 // import browserHistory from 'history/createBrowserHistory';