2

有没有办法去除左侧 xAxis gridLine 左侧 yAxis gridLine 边缘的像素?

网格线重叠

见例子:http: //jsfiddle.net/48LvK/

$(function () {
    var chart;
    $(document).ready(function() {
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                type: 'area',
                marginRight: 130,
                marginBottom: 25
            },
            "xAxis": {
                "tickWidth": 0,
                "gridLineWidth": 1,
                "gridLineDashStyle": "ShortDot",
                "gridLineColor": "#c1c2c3",
                "labels": {
                    "enabled": false
                },
            },
            "yAxis": {

            },
            "plotOptions": {
                "area": {
                    "fillColor": "transparent",
                    "marker": {
                        "enabled": false
                    }
                }
            }, 
            series: [{
                data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
            }]
        });
    });
});
4

1 回答 1

6

您需要将 startOnTick: true 添加到您的 xAxis http://jsfiddle.net/sppRL/

    "xAxis": {
        "tickWidth": 0,
        "gridLineWidth": 1,
        "gridLineDashStyle": "ShortDot",
        "gridLineColor": "#c1c2c3",
        "labels": {
            "enabled": false
        },
        "startOnTick": true
    },

您所看到的实际上并不是刻度线,它们是 y 轴在第一个 xAxis 刻度左侧的延伸。

http://api.highcharts.com/highcharts#xAxis

于 2013-07-18T17:19:35.547 回答