echarts
echarts copied to clipboard
[Feature] Custom axis label position
What problem does this feature solve?
I have a requirement. The axis tick display Monday of the week, and now i want to display the week number in the middle of the two ticks. Similar to add label above Minor Ticks. My data is like this: ["year":"2022", "week": 52, "monday": "2022/12/26"].
need your help, thanks a lot.

What does the proposed API look like?
xAxis: {
axisLabel: {
show: true,
offset: '50%',
formatter: function(value, index) {
var year = _data.Week.Data[index].Year;
var week = _data.Week.Data[index].Week;
return `${year}\nWeek ${week}`;
}
},
// or
minorTick: {
show: true,
labelText: "2022\nWeek 26",
splitNumber: 2,
length: 0
}
}