Highcharts:从windrose图表中删除1个标签

时间:2013-03-11 09:00:58

标签: highcharts label

我使用highcharts创建了一个风玫瑰型图表,类似于标签 需要删除

我尝试使用:{ lables: { enabled: false } }并尝试使用 showFirstLabelshowLastLabel

但它对我不起作用:(

以下是我创建风玫瑰图表的方法:

wind_rose_chart = Highcharts.data({
    table: 'roulette_windrose',
    startRow: 1,
    endRow: 38,
    endColumn: 37,
    complete: function (options) {
        // Create the chart
        window.chart = new Highcharts.Chart(Highcharts.merge(options, {
            chart: {
                renderTo: 'windrose_container',
                polar: true,
                type: 'column',
                animation: false,
                backgroundColor: '#e4e6e1',
                plotBackgroundImage: "/images/gallery/windrose_roulette.png",
                height: 400,
                width: 350,

            },
            colors: ['#008403',
                     '#E30000','#000000','#E30000',
                     '#000000','#E30000','#000000',
                     '#E30000','#000000','#E30000',
                     '#000000','#000000','#E30000',
                     '#000000','#E30000','#000000',
                     '#E30000','#000000','#E30000',
                     '#E30000','#000000','#E30000',
                     '#000000','#E30000','#000000',
                     '#E30000','#000000','#E30000',
                     '#000000','#000000','#E30000',
                     '#000000','#E30000','#000000',
                     '#E30000','#000000','#E30000'],
            title: {
                text: 'Spots'
            },
            pane: {
                size: '70%'
            },

            legend: {
                enabled: false
            },

            xAxis: {
                labels: {
                    enabled: false
                },
                showFirstLabel: false,
                showLastLabel: false,
                tickmarkPlacement: 'on',
                lineWidth:0,
                gridLineWidth: 0
            },
            yAxis: {
                min: 0,
                gridLineWidth: 0,
                endOnTick: false,
                showLastLabel: false,
                showFirstLabel: false,
                labels: {
                    formatter: function () {
                        return this.value;
                    }
                }
            },

            tooltip: {
                formatter: function() {
                    return this.y;
                }
            },

            plotOptions: {
                series: {
                    stacking: 'normal',
                    shadow: false,
                    groupPadding: 0,
                    pointPlacement: 'on',
                }
            },
            navigation: {
                buttonOptions: {
                    enabled: true
                }
            },
            exporting: {
                enabled: true
            },
            credits: {
                enabled: false
            }
        }));

    }
});

1 个答案:

答案 0 :(得分:3)

以下代码正在运行:

yAxis: {
    ...
    labels: {
        enabled: false
    }
}

DEMO