Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Highcharts 高度图表-网格线高度_Highcharts - Fatal编程技术网

Highcharts 高度图表-网格线高度

Highcharts 高度图表-网格线高度,highcharts,Highcharts,我希望highchart的网格线只显示到图表高度的75%,而图表的其余部分不应显示网格线。有没有办法设置网格线的高度 xAxis:{ 网格线宽度:1, gridLineDashStyle:“longdash”, gridLineColor:“#b3Bab”, }通常不支持,但简单的更改将允许您: (function(H) { H.wrap(H.Tick.prototype, 'render', function(p, index, old, opacity) { var

我希望highchart的网格线只显示到图表高度的75%,而图表的其余部分不应显示网格线。有没有办法设置网格线的高度

xAxis:{
网格线宽度:1,
gridLineDashStyle:“longdash”,
gridLineColor:“#b3Bab”,

}
通常不支持,但简单的更改将允许您:

(function(H) {
    H.wrap(H.Tick.prototype, 'render', function(p, index, old, opacity) {
        var tick = this,
            d,
            size = 0.25; // = 75%, 0.5 = 50%, 0.75 = 25% etc.
        p.call(this, index, old, opacity);

        if(tick.gridLine && this.axis.isXAxis) {

            d = tick.gridLine.d.split(' '); // get default path

            d[2] = ( d[5] - d[2] ) * size + tick.axis.chart.plotTop; // modify path - don't forget about plotTop

            tick.gridLine.attr({
                d: d // apply new path
            });
        }

    });
})(Highcharts)