//刻度尺
progressChart() {
let myEcharts = echarts.init(this.$refs.progressChart);
var option = {
grid: {
left: "1%",
right: "60%",
top: "10px",
bottom: "30px",
containLabel: true,
},
xAxis: {
type: "category",
boundaryGap: true,
show: false,
},
yAxis: {
min: 1,
max: 200,
splitNumber: 6,
type: "value",
// 刻度线
axisTick: {
show: true,
length: 4,
lineStyle: {
color: "#fff",
},
},
axisLine: {
show: true,
lineStyle: {
color: "#fff",
},
},
splitLine: {
show: false,
},
axisLabel: {
show: true,
color: "#fff",
// formatter: function(v) {
// let item = "";
// if (v === 1) {
// item = "1";
// } else if (v === 2) {
// item = "2";
// } else if (v === 5) {
// item = "5";
// } else if (v === 10) {
// item = "10";
// } else if (v === 20) {
// item = "20";
// } else if (v === 50) {
// item = "50";
// }
// return item;
// },
},
},
series: [
{
data: [20],
type: "bar",
barWidth: 10,
itemStyle: {
color: "#00ff00",
},
},
],
};
myEcharts.setOption(option);
},
echarts实现刻度尺
最新推荐文章于 2024-05-20 19:14:28 发布