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