修改bug

This commit is contained in:
‘937886381’
2024-01-24 17:16:05 +08:00
parent 3bc12b8830
commit c47dddfcdc
14 changed files with 1458 additions and 38 deletions

View File

@@ -83,20 +83,38 @@ export default {
this.chart = null
},
methods: {
initChart(nameList,dataList) {
initChart(nameList, dataList) {
console.log('1111', dataList);
// console.log(1)
this.chart = echarts.init(document.getElementById(this.id))
if (dataList.length !== 0) {
// if (dataList.length !== 0) {
// this.$set(this.series, "data", dataList);
this.series = [{
type: 'bar',
data: dataList,
barWidth: 6
itemStyle: {
normal: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// { offset: 0, color: '#9DD5FF' },
// { offset: 0.3, color: '#1295FF' }
// ]),
label: {
show: true, //开启显示
position: 'top', //在上方显示
textStyle: { //数值样式
color: '#ced1d5',
fontSize: 12
}
},
}
// barBorderRadius: this.borderRadius
},
barWidth: 12,
}]
}
if (nameList.length !== 0) {
// }
// if (nameList.length !== 0) {
this.nameList = nameList
}
// }
this.chart.setOption({
tooltip: {
trigger: 'axis',
@@ -112,6 +130,16 @@ export default {
bottom: '3%',
containLabel: true
},
// legend: {
// itemWidth: 10,
// itemHeight: 10,
// // right: '20px',
// data: nameList,
// textStyle: {
// fontSize: 12 * this.beilv,
// color: '#ced1d5'
// }
// },
xAxis: {
type: 'category',
axisLine: {