line chart is displayed only on the mouse. How can the origin and data be displayed by default?
setOption({
//
title: {
text: "Job",
left: "30",
textStyle: {
fontSize: 18,
fontWeight: 500
},
subtext:"Job",
subtextStyle:{
fontSize:14,
color:"-sharp666"
}
},
tooltip: {
enterable: true,
trigger: "axis",
axisPointer: {
type: "cross",
label: {
backgroundColor: "-sharp6a7985"
}
},
formatter: function (params, ticket, callback) {//
let dataIndex = params[0].dataIndex;
let normalValue,
errorValue;
errorValue = _this.countResultStatusData.monthBuildErrorNums[dataIndex];
normalValue = _this.countResultStatusData.monthBuildSuccNums[dataIndex];
let relVal = params[0].name + "<br/>";
relVal += "<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:-sharp31c263"></span>" + " : " + normalValue + "<br/>";
relVal += "<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:-sharpf77448"></span>" + " : " + errorValue + "<br/>";
return relVal;
}
},
legend: {
data: [""],
right:20
},
toolbox: {},
grid: {
left: "6%",
right: "10%",
bottom: "10%",
containLabel: true
},
xAxis: [
{
alignWithLabel:true,
type: "category",
boundaryGap: false,
data: _this.countResultStatusData.months,
name: "/",
nameTextStyle:{
color:"-sharp333",
},
}
],
yAxis: [
{
type: "value",
name: "Job",
nameLocation:"center",
nameTextStyle:{
color:"-sharp888",
padding: [10, 40]
},
minInterval:1,
maxInterval:10
},
{
type: "value",
nameLocation:"center",
nameTextStyle:{
color:"-sharp888",
padding: [10, 40]
},
minInterval:1,
maxInterval:10
}
],
series: [
{
name: "",
type: "line",
showAllSymbol: true,
stack: "",
label: {
normal: {
show: true,
position: "top",
}
},
symbolSize: 10,
itemStyle:{
borderWidth:2
},
areaStyle: {
normal: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: "-sharpffba9b" // 0%
}, {
offset: 1, color: "-sharpffffff" // 100%
}],
globalCoord: false // false
}
}
},
data: _this.countResultStatusData.monthBuildNums
}
]
})`
![][2]