1
votes

I am using high-charts column chart. Here is my chart options ( y axis portion ).

        yAxis: {
            allowDecimals: false,
            min: 0,
            max: 100,
            tickInterval: 25,
            title: {
                text: ''
            }
//                labels: {
//                    formatter: function () {
//                        
//                    }
//                }
        },

Currently, it is displaying y axis label from 0 to 100. But, I would like to append '%' symbol to only '0' and leave rest of the labels as is. I tried sing label formatter, couldn't figure which values to use. Can any one suggest me any idea ?

Thanks

2

2 Answers

1
votes

You can try:

       labels: {
            formatter: function() {
                return this.value === 0 ? '0%' : this.value;
            }
        }

http://jsfiddle.net/6huhbqhj/

1
votes

Figured it.

                 labels: {
                formatter: function () {
                    if (this.value == 0)
                        return this.value + "%";
                    else
                        return this.value;
                }
            }