Highchart使用Group By Year定制x轴值

时间:2016-02-15 05:14:28

标签: highcharts

我想显示条形图x轴组年份,例如最近我有一个类似的图表

http://postimg.org/image/xt6p09d5l/

但是我希望像下面的图片

中提到的那样逐年分组x轴

http://postimg.org/image/zas5bthw9/

请告诉我如何在条形图中的Highcharts中实现这一目标?

1 个答案:

答案 0 :(得分:0)

您可以使用群组类别扩展程序。

http://www.highcharts.com/plugin-registry/single/11/Grouped-Categories

xAxis: {
        categories: [{
            name: "Fruit",
            categories: ["Apple", "Banana", "Orange"]
        }, {
            name: "Vegetable",
            categories: ["Carrot", "Potato", "Tomato"]
        }, {
            name: "Fish",
            categories: ["Cod", "Salmon", "Tuna"]
        }]
    }