修改leftcharts2 样式

This commit is contained in:
ljx 2025-03-14 11:03:32 +08:00
parent c815dbbe61
commit 27fe855a2e
1 changed files with 51 additions and 41 deletions

View File

@ -5,6 +5,7 @@
</template> </template>
<script> <script>
import * as echarts from 'echarts';
function getRecentSixMonths() { function getRecentSixMonths() {
const months = []; const months = [];
const today = new Date(); const today = new Date();
@ -22,7 +23,6 @@ function getRecentSixMonths() {
return months; return months;
} }
import * as echarts from 'echarts';
export default { export default {
name: 'RoseChart', name: 'RoseChart',
props: { props: {
@ -47,29 +47,35 @@ export default {
console.log(myChart) console.log(myChart)
this.option = { this.option = {
title: { title: {
text: '月生产情况', text: '近半年产量情况',
subtext: '完成率', // subtext: '',
subtextStyle:{ // subtextStyle:{
fontSize:20, // fontSize:20,
fontWight:'bold', // fontWight:'bold',
color:'#fff' // color:'#fff'
}, // },
textStyle:{ textStyle:{
fontSize:25, fontSize:30,
fontWight:'bold', fontWight:'bold',
color:'#fff' color:'#fff'
} }
}, },
legend: {
icon: 'rect',
itemWidth: 20, //
itemHeight: 20, //
itemGap: 40, //
data: this.dataType == '整机' ? ['整机线'] : ['整机', '机芯', '盖板'],
textStyle: {
color: '#fff',
fontSize:30,
fontWight:'bold'
}
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
}, },
legend: {
data: this.dataType == '整机' ?['机芯1线', '机芯2线', '盖板线'] : ['整机线'],
textStyle:{
fontSize:25,
color:'#fff'
}
},
toolbox: { toolbox: {
}, },
calculable: true, calculable: true,
@ -82,7 +88,7 @@ export default {
} }
}, },
axisLabel: { axisLabel: {
fontSize: 20, // Y fontSize: 30, // Y
color: '#fff' // color: '#fff' //
}, },
// prettier-ignore // prettier-ignore
@ -98,16 +104,21 @@ export default {
} }
}, },
axisLabel: { axisLabel: {
fontSize: 20, // Y fontSize: 30, // Y
color: '#fff' // color: '#fff' //
}, },
} }
], ],
grid: {
left: '3%',
right: '7%',
bottom: '3%',
containLabel: true
},
series: series:
this.dataType == '整机' ? this.dataType == '整机' ?[
[
{ {
name: '整机线', name: '整机',
type: 'bar', type: 'bar',
data: [ data: [
75, 65, 68, 69, 40, 82 75, 65, 68, 69, 40, 82
@ -122,10 +133,9 @@ export default {
data: [{ type: 'average', name: 'Avg' }] data: [{ type: 'average', name: 'Avg' }]
} }
} }
]: ]:[
[
{ {
name: '芯1线', name: '机',
type: 'bar', type: 'bar',
data: [ data: [
75, 65, 68, 69, 40, 82 75, 65, 68, 69, 40, 82
@ -136,41 +146,41 @@ export default {
{ type: 'min', name: 'Min' } { type: 'min', name: 'Min' }
] ]
}, },
markLine: { // markLine: {
data: [{ type: 'average', name: 'Avg' }] // data: [{ type: 'average', name: 'Avg' }]
} // }
}, },
{ {
name: '机芯2线', name: '机芯',
type: 'bar', type: 'bar',
data: [ data: [
70, 75, 88, 85, 97, 85, 75, 78, 59, 80, 82, 63 70, 75, 88, 85, 97, 85,
], ],
markPoint: { markPoint: {
data: [ data: [
{ name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 }, { type: 'max', name: 'Max' },
{ name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 } { type: 'min', name: 'Min' }
] ]
}, },
markLine: { // markLine: {
data: [{ type: 'average', name: 'Avg' }] // data: [{ type: 'average', name: 'Avg' }]
} // }
}, },
{ {
name: '盖板线', name: '盖板',
type: 'bar', type: 'bar',
data: [ data: [
80, 85, 78, 75, 67, 45, 55, 68, 49, 50, 72, 93 80, 85, 78, 75, 67, 45
], ],
markPoint: { markPoint: {
data: [ data: [
{ name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 }, { type: 'max', name: 'Max' },
{ name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 } { type: 'min', name: 'Min' }
] ]
}, },
markLine: { // markLine: {
data: [{ type: 'average', name: 'Avg' }] // data: [{ type: 'average', name: 'Avg' }]
} // }
} }
] ]
}; };