2
votes

Can I set Custom label values for X axis in amcharts js? Type is xy.

enter image description here

On X axis I had labels 0, 10, 20, 30, 40, 50... Need to set 0, 1, 10, 100

1

1 Answers

2
votes

You could just add the values into your data provider components, such as...

"dataProvider": [
    {
        "category": "0",
        "column-1": 32
    },
    {
        "category": "1"
    },
    {
        "category": "10",
        "column-1": 32
    },
    {
        "category": "100"
    },
    {
        "category": "1000",
        "column-1": 14
    }
];

To make the data on the chart start on the axis then ensure the "startOnAxis": true is within your categoryAxis section.

"categoryAxis":
{
    "startOnAxis": true
}