如何隐藏highchart x轴数据值 [英] how to hide highchart x - axis data values

查看:278
本文介绍了如何隐藏highchart x轴数据值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 highchart.js绘制条形图



我不想显示x轴数据值。



任何人都可以告诉我哪个选项可以吗?


完整配置:

  var chart = new Highcharts.Chart({
图:{
renderTo:container,
defaultSeriesType:'bar'
},
title:{
text:null
},
字幕:{
text:null
},
xAxis:{
categories:[''],
title:{
text:null
},
labels:{enabled:true,y:20,rotation:-45,align:'right'}

},
yAxis:{
min:0,
gridLineWidth:0,
title:{
text:'',
align:'high'
}
},
tooltip:{
formatter:function(){
return'';











$ b $ point $ :35,
颜色:'#D9CDC1'
}
},
图例:{
启用:false
},
学分: {
enabled:false
},
series:[{
name:'Year 1800',
data:[107]
}]
});


解决方案

在HighCharts中,条形图使用倒立轴,所以底部轴线确实是Y轴线。 (另请参见图形旋转90度的列图,在这种情况下,底部轴是X轴。)

您需要将以下内容添加到yAxis config
$ b $ pre $ 标签:
{
启用:false
}

请参阅以下完整示例:
http://jsfiddle.net/k5yBj/433/


I am drawing a bar chart using highchart.js

I do not want to show the x - axis data values.

Can any one tell me which option does it?
full config:

var chart = new Highcharts.Chart({
                chart: {
                    renderTo: container,
                    defaultSeriesType: 'bar'
                },
                title: {
                    text: null
                },
                subtitle: {
                    text: null
                },
                xAxis: {
                    categories: [''],
                    title: {
                        text: null
                    },
                    labels: {enabled:true,y : 20, rotation: -45, align: 'right' }

                },
                yAxis: {
                    min: 0,
                    gridLineWidth: 0,
                    title: {
                        text: '',
                        align: 'high'
                    }
                },
                tooltip: {
                    formatter: function () {
                        return '';
                    }
                },
                plotOptions: {
                    bar: {
                        dataLabels: {
                            enabled: true
                        },
                        pointWidth: 35,
                        color: '#D9CDC1'
                    }
                },
                legend: {
                    enabled: false
                },
                credits: {
                    enabled: false
                },
                series: [{
                    name: 'Year 1800',
                    data: [107]
                }]
            });

解决方案

In HighCharts, bar graphs use inverted axes, so the bottom axis is really the Y axis. (See also "column" graphs where the graphic is rotated 90 degrees, in which case the bottom axis is the X axis.)

You need to add the following to the yAxis config

labels:
{
  enabled: false
}

See the following for full example: http://jsfiddle.net/k5yBj/433/

这篇关于如何隐藏highchart x轴数据值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆