Commit f9533343 authored by jim's avatar jim

Merge branch 'master' into v2

parents 5b134797 42e22677
...@@ -3,7 +3,6 @@ const path = require('path'); ...@@ -3,7 +3,6 @@ const path = require('path');
export default { export default {
entry: 'src/index.js', entry: 'src/index.js',
extraBabelPlugins: [ extraBabelPlugins: [
'transform-decorators-legacy',
['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }], ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }],
], ],
env: { env: {
......
{ {
"name": "ant-design-pro", "name": "ant-design-pro",
"version": "1.2.1", "version": "1.3.0",
"description": "An out-of-box UI solution for enterprise applications", "description": "An out-of-box UI solution for enterprise applications",
"private": true, "private": true,
"scripts": { "scripts": {
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
"babel-plugin-dva-hmr": "^0.4.1", "babel-plugin-dva-hmr": "^0.4.1",
"babel-plugin-import": "^1.6.7", "babel-plugin-import": "^1.6.7",
"babel-plugin-module-resolver": "^3.1.1", "babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"cross-env": "^5.1.1", "cross-env": "^5.1.1",
"cross-port-killer": "^1.0.1", "cross-port-killer": "^1.0.1",
"enzyme": "^3.1.0", "enzyme": "^3.1.0",
......
...@@ -7,7 +7,7 @@ import styles from './index.less'; ...@@ -7,7 +7,7 @@ import styles from './index.less';
const renderTotal = total => { const renderTotal = total => {
let totalDom; let totalDom;
switch (typeof total) { switch (typeof total) {
case undefined: case 'undefined':
totalDom = null; totalDom = null;
break; break;
case 'function': case 'function':
......
...@@ -19,7 +19,7 @@ export default class Pie extends Component { ...@@ -19,7 +19,7 @@ export default class Pie extends Component {
}; };
componentDidMount() { componentDidMount() {
this.getLengendData(); this.getLegendData();
this.resize(); this.resize();
window.addEventListener('resize', this.resize); window.addEventListener('resize', this.resize);
} }
...@@ -33,7 +33,7 @@ export default class Pie extends Component { ...@@ -33,7 +33,7 @@ export default class Pie extends Component {
legendData: [...this.state.legendData], legendData: [...this.state.legendData],
}, },
() => { () => {
this.getLengendData(); this.getLegendData();
} }
); );
} }
...@@ -49,7 +49,7 @@ export default class Pie extends Component { ...@@ -49,7 +49,7 @@ export default class Pie extends Component {
}; };
// for custom lengend view // for custom lengend view
getLengendData = () => { getLegendData = () => {
if (!this.chart) return; if (!this.chart) return;
const geom = this.chart.getAllGeoms()[0]; // 获取所有的图形 const geom = this.chart.getAllGeoms()[0]; // 获取所有的图形
const items = geom.get('dataArray') || []; // 获取图形对应的 const items = geom.get('dataArray') || []; // 获取图形对应的
......
...@@ -71,8 +71,8 @@ export default class TimelineChart extends React.Component { ...@@ -71,8 +71,8 @@ export default class TimelineChart extends React.Component {
const timeScale = { const timeScale = {
type: 'time', type: 'time',
tickCount: 10, tickInterval: 60 * 60 * 1000,
mask: 'HH:MM', mask: 'HH:mm',
range: [0, 1], range: [0, 1],
}; };
......
...@@ -15,7 +15,24 @@ import TimelineChart from './TimelineChart'; ...@@ -15,7 +15,24 @@ import TimelineChart from './TimelineChart';
const yuan = val => `¥ ${numeral(val).format('0,0')}`; const yuan = val => `¥ ${numeral(val).format('0,0')}`;
const Charts = {
yuan,
Bar,
Pie,
Gauge,
Radar,
MiniBar,
MiniArea,
MiniProgress,
ChartCard,
Field,
WaterWave,
TagCloud,
TimelineChart,
};
export { export {
Charts as default,
yuan, yuan,
Bar, Bar,
Pie, Pie,
......
--- ---
title: title:
en-US: Charts en-US: Charts
zh-CN: Charts zh-CN: Charts
subtitle: 图表 subtitle: 图表
...@@ -59,7 +59,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -59,7 +59,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
|----------|------------------------------------------|-------------|-------| |----------|------------------------------------------|-------------|-------|
| title | 图表标题 | ReactNode\|string | - | | title | 图表标题 | ReactNode\|string | - |
| color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` | | color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` |
| margin | 图表内部间距 | array | \[32, 0, 32, 40\] | | padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
| data | 数据 | array<{x, y}> | - | | data | 数据 | array<{x, y}> | - |
| autoLabel | 在宽度不足时,自动隐藏 x 轴的 label | boolean | `true` | | autoLabel | 在宽度不足时,自动隐藏 x 轴的 label | boolean | `true` |
...@@ -72,7 +72,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -72,7 +72,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
| color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` | | color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
| hasLegend | 是否显示 legend | boolean | `false` | | hasLegend | 是否显示 legend | boolean | `false` |
| margin | 图表内部间距 | array | \[24, 0, 24, 0\] | | padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
| percent | 占比 | number | - | | percent | 占比 | number | - |
| tooltip | 是否显示 tooltip | boolean | true | | tooltip | 是否显示 tooltip | boolean | true |
| valueFormat | 显示值的格式化函数 | function | - | | valueFormat | 显示值的格式化函数 | function | - |
...@@ -87,7 +87,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -87,7 +87,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
| title | 图表标题 | ReactNode\|string | - | | title | 图表标题 | ReactNode\|string | - |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
| hasLegend | 是否显示 legend | boolean | `false` | | hasLegend | 是否显示 legend | boolean | `false` |
| margin | 图表内部间距 | array | \[24, 30, 16, 30\] | | padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
| data | 图标数据 | array<{name,label,value}> | - | | data | 图标数据 | array<{name,label,value}> | - |
### Gauge ### Gauge
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment