'Formatter AxisLabel Echarts fontWeight dosn't work

I want format Axis Label of my chart with Echarts, formatter date of weekend to be bold, I tried this code but I can't know why it doesn't work:

    xAxis: [{
                        type: 'category',
                        data: day,
                        inverse: false,
                        splitArea: {
                            show: true
                        },
                        axisLabel: {
                             textStyle: {
                                color: function (value, index) {
                                var d = moment(value).weekday(), index;
                                return (d == 0 || d == 6) ? 'red' : 'black';
                                }
                             },
                            formatter: (function(value, index){
                                    var m = moment(value).format("DD/MM"), index;
                                    return m;
                                }),
                            fontWeight: function (value, index) {
                                var n = moment(value).weekday(), index;
                                return (n == 0 || n == 6) ? 'bold' : 'normal';
                            }
                        },

                    }]

Any help please!!!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source