更改成果概览饼状图

This commit is contained in:
zhangxzz 2023-11-23 16:06:37 +08:00
parent 850d6187c1
commit 056f6f5011
3 changed files with 29 additions and 18 deletions

View File

@ -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>
);

View File

@ -66,11 +66,20 @@ function AchivChart() {
// value0 0null
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);

View File

@ -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
}