Home » Javascript » get yAxis labels as 10% of the categories of xAxis

get yAxis labels as 10% of the categories of xAxis

Posted by: admin June 30, 2018 Leave a comment

Questions:

How to get the yAxis labels as the 10% of the categories defined in the xAxis of the chart. For example, if I have categories like [2010,2011,2012,2013,….] then the yAxis labels should come like 201.0, 201.1, 201.2, …

Here I have basic chart with predefined categories

chart: {
        type: 'spline'
    },
    xAxis: {
        categories: [1340,1590,1379,1451,1671]
    },
    yAxis: {
        title: {
            text: '10% of Range'
        }
    },
    series: [{
        name: 'Tokyo',
        data: [7.0, 6.9, 9.5, 14.5, 18.4]
    }]
}

How to get the yAxis plot values as the 10% of the categories of xAxis, is there any method?
Further I will receive the series and the categories from the server so categories will be numeric.

Answers: