1

我使用 highcharts 创建了一个风玫瑰型图表,以及需要删除的标签之类的东西

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

但这对我不起作用:(

这是我创建风玫瑰图的方法:

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
            }
        }));

    }
});
4

1 回答 1

3

以下代码正在工作:

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

演示

于 2013-03-11T09:15:25.327 回答