how does 1.ECharts increase the chart according to the data? for example, if I have two pieces of data here, how can I add two gauges?
2. This is the code, you need to use c3text and c4text to set the scale of the dashboard:
] [1]
3. This is the code:
var rounds = document.querySelector ("div.round");
var _watchHtml = "";
//this._valueDatas
this._valueDatas.forEach(function (value,index,array) {
//
value = eval("("+ value +")");
//
console.log(array.length)
_watchHtml += "<div class="watchBox"><div class="watch"></div></div>"
rounds.innerHTML = _watchHtml;
//
var watch = echarts.init(document.querySelector(".watch"));
var option = {
tooltip: {
formatter: "{a} <br/>{b} : {c}%"
},
textStyle: {
fontSize: 8,
},
series: [
{
name: "",
type: "gauge",
radius: "100%",
splitNumber: 6,
center: [119, 110],
min: 0,
max: 60,
detail: {
formatter: "{value}min",
fontSize: 10,
offsetCenter: ["0%", "60%"]
},
data: [{value: 30}],
axisLine: {
lineStyle: {
color: [
[0.165, "-sharp91c7ae"],
[0.33, "-sharpFF33CC"],
[0.5, "-sharp9966CC"],
[0.67, "-sharpFF6600"],
[0.83, "-sharp6633CC"],
[1, "-sharpc23531"]
]
}
},
axisLabel: {
distance: 5,
fontSize: 10,
},
pointer: {
show: true,
length: "60%",
width: 5,
}
}
]
}
watch.setOption(option);
setInterval(function () {
option.series[0].data[0].value = (Math.random() * 60).toFixed(2) - 0;
watch.setOption(option, true);
}, 2000);
})