在设计一个项目中的数据展示页面时,想要设计双X轴,一个轴显示需要的项,一个轴对这些项进行分组,效果如图:
$(function () { var chart = new Highcharts.Chart({ chart: { renderTo: "container", type: "column" }, title: { text: null }, plotOptions: { column: { stacking: 'normal', dataLabels: { enabled: false, color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white' } } }, series: [{ name: '新', color: '#FF3300', type: 'column', data: [4, 14, 18, 5, 6, 5, 14, 15, 18] },{ name: '循', color: '#009900', type: 'column', data: [4, 14, 18, 5, 6, 5, 14, 15, 18] } ,{ name: '备', color: '#FFFF33', type: 'column', data: [4, 14, 18, 5, 6, 5, 14, 15, 18] }], xAxis: { categories: [{ name: "2011年", categories: ["一", "二", "三"] }, { name: "2012年", categories: ["一", "二", "三"] }, { name: "2013年", categories: ["一", "二", "三"] }] } }); });