伪数组示例:
工厂地址= [“abc”,“dbc”,“asd”]
opr_no_arr = [“公司1,““公司2,““公司3”]
draft_arr = [0:{x:“abc”,y:“公司1”},1:{x:“bds”,y:“公司2”},2:{x:“数据库”,y:“公司3”}]
等待创建= [0:{x:“abc”,y:“公司1”},1:{x:“bds”,y:“公司2”},2:{x:“dbc”,y:“公司3”}]
创建时间= [0:{x:“abc”,y:“公司1”},1:{x:“bds”,y:“公司2”},2:{x:“数据库”,y:“公司3”}]
name: "Pending For Creation",
data: draft_arr,
color:"#000000"
},{
name: "Created",
data: created_arr,
color:'#FF0000'
},{
name: "Execution In Progress",
data: execution_arr,
color:'#FFAE42'
},
{
name: "Completed",
data: completed_arr,
color:'#28a745'
}],
chart: {
height: 350,
type: 'scatter',
zoom: {
enabled: true,
type: 'xy'
},
},
xaxis: {
type: 'category',
//tickAmount: 10,
categories: plant_arr,
}, this is working
yaxis:
{
//type: 'category',
// tickAmount:1,
// categories : opr_no_arr,
labels: {
maxWidth: "auto",
formatter: (val : string, index) => opr_no_arr[index], //error cant show particaular labels
},
title: {
text: "OPR",
style: {
colors: "#000000"
}
}
},
legend: {
position: "top",
horizontalAlign: "right"
}
};
this.first_chartRef = new ApexCharts(document.getElementById('first'), chartOptions);
this.first_chartRef.render();
}
1条答案
按热度按时间osh3o9ms1#
y轴:{类型:'类别',勾选金额:6,类别:opr_no_arr,标签:{最大宽度:“auto”,},}保持这样并检查?