在多y轴高图中重叠Y轴

时间:2013-05-15 03:42:47

标签: javascript charts highcharts highstock

我正在尝试添加多个yaxis highstock。绘图工作正常,但轴标签重叠&总的来说,它看起来很笨拙。这是它的快照! Highchart Multi-Y

我使用this example创建了多y图表。

你能帮帮忙吗?

这些是我目前使用的格式选项

var options = {};
options.xAxis = {
        labels : {
            enabled : true
        }

    };
    options.title = {
        text : "Highchart",
        style: {
            fontSize: '14px',
            fontWeight: '800'
        }
    };
    options.subtitle = {
        text : ""
    };
    options.chart = {

        borderColor : '#BBBBBB',
        borderWidth : 0,
        borderRadius : 20,
        zoomType : 'xy'
    };
//  options.yAxis={min:0};
    options.yAxis=[{ // Transaction Count_URL
        labels: {
            formatter: function() {
                var value= this.value;

                if(value>=1000000000)
                    ret = (value / 1000000000) + 'G'
                else if(value>=1000000)
                    ret = (value / 1000000) + 'M';
                else if(value>=1000)
                    ret = (value / 1000) + 'k';
                else
                    ret=value;

                return ret;
            },
            style: {
                color: '#89A54E'
            }
        },
        title: {
            text: 'Memory Used',
            style: {
                color: '#89A54E'
            }
        },
        opposite: true

    }, { // Transaction count_EXEC
        gridLineWidth: 0,
        title: {
            text: 'GC Count',
            style: {
                color: '#4572A7'
            }
        },
        labels: {
            formatter: function() {
                return this.value;
            },
            style: {
                color: '#4572A7'
            }
        }

    }, { // Tertiary yAxis
        gridLineWidth: 0,
        title: {
            text: 'TPS',
            style: {
                color: '#AA4643'
            }
        },
        labels: {
            formatter: function() {
                return this.value;
            },
            style: {
                color: '#AA4643'
            }
        },
        opposite: true
    }],

    options.navigator=
    {
        enabled: false
    };

    options.credits = {
        enabled : false
    };

    options.xAxis = {
        type : 'datetime'
    };
    options.series = [];



    options.rangeSelector = {
        enabled : false
    };
    options.series=[];

    options.tooltip = {
        shared : false,
        snap : 0

    };
    options.scrollbar = {
        enabled : false
    };
    options.navigation = {
        buttonOptions : {
            enabled : false
        }
    };

1 个答案:

答案 0 :(得分:3)

您可以为x轴http://api.highcharts.com/highcharts#yAxis.offset

设置偏移参数
相关问题