|
|
@ -135,7 +135,7 @@ export class EhartsStatisticsComponent implements OnInit { |
|
|
|
let catalogs = [] //学习目标
|
|
|
|
let catalogs = [] //学习目标
|
|
|
|
let counts = [] //统计次数
|
|
|
|
let counts = [] //统计次数
|
|
|
|
let newData = data.sort( function (a,b) { |
|
|
|
let newData = data.sort( function (a,b) { |
|
|
|
return a.count - b.count |
|
|
|
return b.count - a.count |
|
|
|
} ) |
|
|
|
} ) |
|
|
|
newData.forEach(element => { |
|
|
|
newData.forEach(element => { |
|
|
|
postNames.push(element.postName) |
|
|
|
postNames.push(element.postName) |
|
|
@ -167,22 +167,27 @@ export class EhartsStatisticsComponent implements OnInit { |
|
|
|
boundaryGap: [0, 0.01] |
|
|
|
boundaryGap: [0, 0.01] |
|
|
|
}, |
|
|
|
}, |
|
|
|
yAxis: { |
|
|
|
yAxis: { |
|
|
|
|
|
|
|
inverse: true, |
|
|
|
"axisLine":{ //y轴
|
|
|
|
"axisLine":{ //y轴
|
|
|
|
"show":false |
|
|
|
"show":false |
|
|
|
}, |
|
|
|
}, |
|
|
|
"axisTick":{ //y轴刻度线
|
|
|
|
"axisTick":{ //y轴刻度线
|
|
|
|
"show":false |
|
|
|
"show":false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
"splitLine": { //网格线
|
|
|
|
"splitLine": { //网格线
|
|
|
|
"show": false |
|
|
|
"show": false |
|
|
|
}, |
|
|
|
}, |
|
|
|
type: 'category', |
|
|
|
type: 'category', |
|
|
|
data: postNames |
|
|
|
data: postNames, |
|
|
|
|
|
|
|
max: function (value) { |
|
|
|
|
|
|
|
return 100/postNames.length; |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
series: [ |
|
|
|
series: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: 'bar', |
|
|
|
type: 'bar', |
|
|
|
data: counts, |
|
|
|
data: counts, |
|
|
|
|
|
|
|
barMaxWidth: 40, // 最大宽度
|
|
|
|
itemStyle:{ |
|
|
|
itemStyle:{ |
|
|
|
normal:{ |
|
|
|
normal:{ |
|
|
|
color:'#40B4E8', |
|
|
|
color:'#40B4E8', |
|
|
|