如何降低highcharts中细胞的高度

时间:2015-10-06 06:17:23

标签: highcharts

我有一个使用highcharts构建的区域图表,我试图减少y轴单元格列之间的一些空格意味着将高度从0减少到1,1到2等,但没有得到正确的结果。怎么实现呢?

enter image description here

jQuery(document).ready(function () {
            var txt = document.getElementById('hdnYaxis');
            var txtFoxXAxis = document.getElementById('hdnXaxis');
            $('#container').highcharts({
                chart: {
                    type: 'area'
                },
                title: {
                    text: 'Monthly Status'
                },
                xAxis: {
                    categories: $.parseJSON(txtFoxXAxis.value),
                    labels: {
                        style: {
                            color: 'red'


                        }

                    },
                    maxPadding: 0,
                },

                tooltip: {
                    pointFormat: '{series.name} <b>{point.y:,.0f}'
                },
                plotOptions: {
                    area: {

                        marker: {
                            enabled: false,
                            symbol: 'circle',
                            radius: 2,
                            states: {
                                hover: {
                                    enabled: true
                                }
                            }
                        }
                    }
                },
                series:  $.parseJSON(txt.value)
            });
        });

2 个答案:

答案 0 :(得分:0)

在yAxis中设置tickPixelInterval,使用:

 yAxis: {
        tickPixelInterval: 10 // whatever you want
    }

答案 1 :(得分:0)

将yAxis上的maxPadding设置为0。

yAxis:{
   maxPadding:0
}