效果图:
<script>
import echarts from 'echarts'
export default {
name: "operation",
components: {},
computed: {},
data() {
return {
//------------- 质量柏拉图状态----------------
//质量柏拉图Y轴最大值:
Max:500,
//质量柏拉图名称数组
PlatoName:['a1','a2','z3','a4','z5'],
//质量柏拉图数量
PlatoQuantity: [320,300,280,230,210],
//质量柏拉图百分比
PlatoPercent: [],
//质量柏拉图百分比number型
PlatoPercentN:[],
//计算后的柏拉图百分比
computedPlato:[70.2,72.8,76.1,78.3,79.8],
},
methods: {
//获取质量柏拉图数据
deliveryApi() {
this.set_deliveryChart(this.PlatoName, this.PlatoQuantity, this.computedPlato, this.Max)
},
set_deliveryChart(PlatoName, PlatoQuantity, computedPlato, Max) {
let myChart = this.$echarts.init(document.getElementById('fault'));
let option = {
grid: { //调整图表大小
// left: '15%',
// top:"30px",
left: "10%",
right: "10%",
bottom: "10%"
},
xAxis: [
{
type: 'category',
data: PlatoName,//['缺陷原因#