AmCharts堆积柱形图左对齐

时间:2017-12-14 04:24:01

标签: jquery amcharts

当数据仅显示在列上时,我想将图表结果移到左侧。我正在使用AmCharts

我试过这不起作用

categoryAxis: {
                    gridPosition: "start",
                    parseDates: false,
                    gridAlpha: 0
                },

有内置功能吗?请指教,谢谢

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以在类别字段为空的情况下添加一些额外的数据项:

AmCharts.makeChart("chartdiv", {
    "type": "serial",
    "dataProvider": [{
        "category": "DC",
        "europe": 2.5,
        "namerica": 2.5
    }, {
        "category": ""
    }, {
        "category": ""
    }],
    ...
});

请查看此处的示例https://codepen.io/team/amcharts/pen/7761bc970484780c536005c9ab79707f?editors=0010