无法显示类别标签

时间:2019-06-10 22:42:25

标签: highcharts

尝试从此数据获取要显示的类别标签:

{
    "chart": {
        "renderTo": "container",
        "type": "line"
    },
    "title": {
        "text": "Recent Sales Activity for Zipcode 78732"
    },
    "yAxis": {
        "title": {
            "text": "Number of Sales"
        },
        "min": 0
    },
    "xAxis": {
        "catagories": ["Q1 2017", "Q2 2017", "Q3 2017", "Q4 2017", "Q1 2018", "Q2 2018", "Q3 2018", "Q4 2018", "Q1 2019"]
    },
    "series": [{
        "name": "Sales",
        "data": [129, 137, 115, 85, 161, 124, 102, 69, 40]
    }]
}

使用https://export.highcharts.com/

进行测试

2 个答案:

答案 0 :(得分:0)

您在categories属性中有一个错字:

"xAxis": {
    "categories": ["Q1 2017", "Q2 2017", "Q3 2017", "Q4 2017", "Q1 2018", "Q2 2018", "Q3 2018", "Q4 2018", "Q1 2019"]

实时演示: http://jsfiddle.net/BlackLabel/e3qb25cs/

答案 1 :(得分:0)

将xAxis数组中的“ 类别”替换为“ 类别”。

希望它能起作用:)