diff --git a/src/components/Charts/Bar/index.js b/src/components/Charts/Bar/index.js index c63bc92bac043d0d0943af1612e8f5eb3310e186..9eee7a07e57d576fdf42edec24b809d517de4e03 100644 --- a/src/components/Charts/Bar/index.js +++ b/src/components/Charts/Bar/index.js @@ -55,7 +55,14 @@ class Bar extends Component { }; render() { - const { height, title, forceFit = true, data, color = 'rgba(24, 144, 255, 0.85)', padding } = this.props; + const { + height, + title, + forceFit = true, + data, + color = 'rgba(24, 144, 255, 0.85)', + padding, + } = this.props; const { autoHideXLabels } = this.state; @@ -79,16 +86,21 @@ class Bar extends Component { return (
- {title &&

{title}

} + {title &&

{title}

} - - + + diff --git a/src/components/Charts/MiniArea/index.js b/src/components/Charts/MiniArea/index.js index e84a3bc30cf70cd6af36b418bbc0da12c78729c1..2fc1fc82d6fb39e802187b53007e25ffc8c25120 100644 --- a/src/components/Charts/MiniArea/index.js +++ b/src/components/Charts/MiniArea/index.js @@ -11,6 +11,7 @@ export default class MiniArea extends React.Component { data = [], forceFit = true, color = 'rgba(24, 144, 255, 0.2)', + borderColor = '#1089ff', scale = {}, borderWidth = 2, line, @@ -19,8 +20,6 @@ export default class MiniArea extends React.Component { animate = true, } = this.props; - const borderColor = this.props.borderColor || color; - const padding = [36, 5, 30, 5]; const scaleProps = { diff --git a/src/components/Charts/index.less b/src/components/Charts/index.less index 43cfc8bf9d3feefe9e7660f9fcae7e37ec8617dd..190428bc80d7cd7f6f22d51fd48fa37b2d44eb10 100644 --- a/src/components/Charts/index.less +++ b/src/components/Charts/index.less @@ -3,7 +3,7 @@ width: 100%; .chartContent { position: absolute; - bottom: -34px; + bottom: -28px; width: 100%; > div { margin: 0 -5px; diff --git a/src/g2.js b/src/g2.js index 81ca055fe054690147f26820b3833ca8f1e719a1..21e22c28e70c29ecc445fcd1c1f38bde7c82311e 100644 --- a/src/g2.js +++ b/src/g2.js @@ -1,4 +1,15 @@ // 全局 G2 设置 -import { track } from 'bizcharts'; +import { track, setTheme } from 'bizcharts'; track(false); + +const config = { + defaultColor: '#1089ff', + shape: { + interval: { + fillOpacity: 1, + }, + }, +}; + +setTheme(config); diff --git a/src/routes/Dashboard/Analysis.js b/src/routes/Dashboard/Analysis.js index 8cfe32a3cf994ea30381edb4a1f857138f80dac4..8d972ba6c73919a2cd0d1831a1674fe3d7207b5f 100644 --- a/src/routes/Dashboard/Analysis.js +++ b/src/routes/Dashboard/Analysis.js @@ -330,7 +330,7 @@ export default class Analysis extends Component {
- +