forked from Gitlink/forgeplus-react
更改成果概览饼状图
This commit is contained in:
parent
850d6187c1
commit
056f6f5011
|
|
@ -60,13 +60,13 @@ class Index extends Component {
|
|||
)}
|
||||
></Route>
|
||||
|
||||
|
||||
<Route
|
||||
path="/achievement/overview"
|
||||
path="/achievement"
|
||||
render={(props) => (
|
||||
<Overview {...this.props} {...props} />
|
||||
<Overview {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -66,11 +66,20 @@ function AchivChart() {
|
|||
// 如果传入的数据的value为0 则把0变为null
|
||||
let processedData = preprocessData(sortedData);
|
||||
|
||||
|
||||
// 初始化echarts实例
|
||||
const myChart = echarts.init(document.getElementById('chartBox'));
|
||||
|
||||
// 指定图表的配置项和数据
|
||||
const option = {
|
||||
"tooltip": {
|
||||
"trigger": "item",
|
||||
"formatter": function(params) {
|
||||
var value = params.value;
|
||||
var name = params.name.substring(0, 4);
|
||||
return "名称:" + name + "<br>占比:" + value + "%";
|
||||
}
|
||||
},
|
||||
title: {
|
||||
text: '成果数量占比统计',
|
||||
left: 215,
|
||||
|
|
@ -100,16 +109,18 @@ function AchivChart() {
|
|||
],
|
||||
series: [
|
||||
{
|
||||
name: 'Nightingale Chart',
|
||||
name: '成果数量占比',
|
||||
type: 'pie',
|
||||
radius: [35, 145],
|
||||
radius: [45, 145],
|
||||
center: ['160', '50%'],
|
||||
roseType: 'area',
|
||||
clockwise: false,
|
||||
startAngle: 45,
|
||||
itemStyle: {
|
||||
borderRadius: 0
|
||||
borderRadius: 10,
|
||||
borderColor: '#fff',
|
||||
borderWidth: 1
|
||||
},
|
||||
minShowLabelAngle: 10,
|
||||
data: processedData,
|
||||
label: {
|
||||
show: true,
|
||||
|
|
@ -117,7 +128,7 @@ function AchivChart() {
|
|||
color: 'white',
|
||||
formatter: '{c}%', // 显示数据名称和百分比
|
||||
textStyle: {
|
||||
fontSize: 20
|
||||
fontSize: 18
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -131,12 +142,12 @@ function AchivChart() {
|
|||
fill: '#333',
|
||||
fontSize: 18,
|
||||
fontWeight: 'bold',
|
||||
verticalAlign: 'middle',
|
||||
lineHeight: 24
|
||||
verticalAlign: 'middle'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
console.log('option',option)
|
||||
// 使用刚指定的配置项和数据显示图表。
|
||||
myChart.setOption(option);
|
||||
|
||||
|
|
|
|||
|
|
@ -576,7 +576,7 @@ class NewHeader extends Component {
|
|||
}
|
||||
|
||||
matchpaths = (url) => {
|
||||
console.log('@@@进入 newhead > matchpaths');
|
||||
// console.log('@@@进入 newhead > matchpaths');
|
||||
const { match } = this.props;
|
||||
const hostname = window.location.hostname;
|
||||
const port = window.location.port;
|
||||
|
|
@ -594,18 +594,18 @@ class NewHeader extends Component {
|
|||
} else {
|
||||
str = match.path;
|
||||
}
|
||||
console.log(match.path)
|
||||
// console.log(match.path)
|
||||
|
||||
// console.log(str, (url + "/"), url && str === url);
|
||||
if (url && (str === url || str === (url + "/"))) {
|
||||
console.log('@@@ matchpaths true');
|
||||
console.log('url:',url);
|
||||
console.log('str:',str);
|
||||
// console.log('@@@ matchpaths true');
|
||||
// console.log('url:',url);
|
||||
// console.log('str:',str);
|
||||
return true
|
||||
} else {
|
||||
console.log('@@@ matchpaths false');
|
||||
console.log('url:',url);
|
||||
console.log('str:',str);
|
||||
// console.log('@@@ matchpaths false');
|
||||
// console.log('url:',url);
|
||||
// console.log('str:',str);
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue