1. Problem:
When implementing the echarts chart with the x-axis as the time axis and the combination of the scatter chart and the line chart, I encountered a problem, as shown in the figure:
2. Imagine:
the requirement does not need to display the hour, minute and second of the date, but the scatter The graph needs time, minute, and second data. The desired effect is as follows:
3. Realize the configuration
inxAxis
axisPointer: {
label: {
formatter: function (params) {
var date = new Date(params.value)
var day = date.toLocaleDateString();
return day;
}
}}
I hope the recorded problem can help you~