From da087fa21b2aece5e1d749cc32a1ad87ae80eabd Mon Sep 17 00:00:00 2001 From: Hongyuan Ma Date: Sat, 26 May 2018 00:26:36 +0800 Subject: [PATCH] update rate-bar --- front-end/src/page/Status/index.jsx | 15 +++++++++++++- front-end/src/util/rate-bar/index.jsx | 28 +++++++++++++++++++-------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/front-end/src/page/Status/index.jsx b/front-end/src/page/Status/index.jsx index c1d4b36..2e7e271 100644 --- a/front-end/src/page/Status/index.jsx +++ b/front-end/src/page/Status/index.jsx @@ -4,6 +4,18 @@ import ResultFilter from 'component/result-filter/index.jsx'; import RateBar from 'util/rate-bar/index.jsx'; class Status extends React.Component{ + constructor(props) { + super(props); + this.state = { + std: 150000, + curMark1: 243732, + curMark2: 143733, + curMark3: 43732, + curMark4: 3732, + curMark5: 32, + + } + } render(){ return (
@@ -13,7 +25,8 @@ class Status extends React.Component{ Use the farm member link for history of that member on the relevant branch.

- + +
) } diff --git a/front-end/src/util/rate-bar/index.jsx b/front-end/src/util/rate-bar/index.jsx index 12c195d..68ebfc1 100644 --- a/front-end/src/util/rate-bar/index.jsx +++ b/front-end/src/util/rate-bar/index.jsx @@ -18,13 +18,17 @@ class RateBar extends React.Component { constructor(props) { super(props); this.state = { - + std: 150000, + curMark: 143732, } } componentDidMount() { + let std = this.props.std; + let curMark = this.props.curMark; + // init echarts - let myChart = echarts.init(document.getElementById('main')); + let myChart = echarts.init(this.refs.waterall); let option = { tooltip : { trigger: 'axis', @@ -42,11 +46,19 @@ class RateBar extends React.Component { containLabel: true }, xAxis: { - type: 'value' + type: 'value', + show: false, + splitLine:{ + show: false + }, }, yAxis: { type: 'category', - data: ['2 clients','4 clients'] + show: false, + // splitLine:{ + // show: false + // }, + data: ['2 clients'] }, series: [ { @@ -59,10 +71,10 @@ class RateBar extends React.Component { position: 'insideRight' } }, - data: [320, 302] + data: [std] }, { - name: 'std', + name: 'curMark', type: 'bar', stack: 'current', label: { @@ -71,7 +83,7 @@ class RateBar extends React.Component { position: 'insideRight' } }, - data: [120, 132] + data: [curMark] }, ] }; @@ -82,7 +94,7 @@ class RateBar extends React.Component { } render() { return ( -
+
); } } -- 2.39.5