I am trying to create a charts multiple bar in echarts, i want when there is jan(01) first month then its ticks extend 2X then normal size means conditionally
how i can increase ticksize conditionally as i am doing for x axis label in echarts
Is there any way to make itb possible in javascript
Is echarts not support custom function on all property as done in d3.js
const colors = ['#5470C6', '#EE6666'];
option = {
color: colors,
tooltip: {
trigger: 'none',
axisPointer: {
type: 'cross'
}
},
legend: {},
grid: {
width: 1200
},
xAxis: [
{
type: 'category',
axisLabel: {
formatter: function (value, index) {
// Convert timestamp to a Date object
const date = new Date(value);
const month = date.getMonth() + 1; // Months are zero-based
const year = date.getFullYear();
// Check if the month is January
if (month === 1) {
// Increment the year and format as needed
const nextYear = year + 1;
return `${echarts.format.formatTime(
'MM',
date
)}n${year}&&${nextYear}`;
} else {
// Format the label for other months
return echarts.format.formatTime('MM', date);
}
}
},
axisTick: {
show: true,
length: 20
},
// "offset": 10,
axisLine: {
onZero: false,
lineStyle: {
color: colors[1]
}
},
data: [
'2016-1',
'2016-2',
'2016-3',
'2016-4',
'2016-5',
'2016-6',
'2016-7',
'2016-8',
'2016-9',
'2016-10',
'2016-11',
'2016-12',
'2017-1'
]
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: 'Precipitation(2015)',
type: 'bar',
smooth: true,
emphasis: {
focus: 'series'
},
data: [
10, 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
]
}
]
};