Reputation: 5117
Does anybody know. How to make a multiple lines of axis label with Echart (https://echarts.apache.org/examples/en/)?
I need a group label (year, season, ..) and vertical lines for separating groups.
Thank you.
Upvotes: 2
Views: 4549
Reputation: 4450
var myChart = echarts.init(document.getElementById('main'));
var option = {
tooltip: {},
xAxis: [{
data: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
},{
position: 'bottom',
offset: 30,
axisLine: {
show: false,
},
axisTick: {
show: false,
},
data: ['Winter', 'Spring', 'Summer', 'Autumn']
}],
yAxis: {},
series: [{
name: 'Series',
type: 'bar',
data: [5, 20, 36, 10, 10, 20,5, 20, 36, 10, 10, 20]
}]
};
myChart.setOption(option);
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
<div id="main" style="width: 1024px;height:400px;"></div>
Upvotes: 6