HighCharts HighStocks事件标志被图表边框遮盖了

问题描述 投票:1回答:2

如果您的数据点在图表日期的最后一个日期带有事件标记标志,则将其推到图表的最右端时,很难查看。在这种情况下,是否可以为图表添加更多空间?这是来自highstocks网站示例演示的一些经过改编的小提琴代码,其中图表中的最终记录标记为“ A”,说明了此问题...

$(function(){$ .getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?',function(data){

    // Create the chart
    window.chart = new Highcharts.StockChart({
        chart : {
            renderTo : 'container'
        },

        rangeSelector : {
            selected : 1
        },

        title : {
            text : 'USD to EUR exchange rate'
        },

        tooltip: {
            style: {
                width: '200px'
            },
            valueDecimals: 4
        },

        yAxis : {
            title : {
                text : 'Exchange rate'
            }
        },

        series : [{
            name : 'USD to EUR',
            data : data,
            id : 'dataseries'
        },
        // the event marker flags
        {
            type : 'flags',
            data : [{
                x : Date.UTC(2011, 3, 25),
                title : 'H',
                text : 'Euro Contained by Channel Resistance'
            }, {
                x : Date.UTC(2011, 3, 28),
                title : 'G',
                text : 'EURUSD: Bulls Clear Path to 1.50 Figure'
            }, {
                x : Date.UTC(2011, 4, 4),
                title : 'F',
                text : 'EURUSD: Rate Decision to End Standstill'
            }, {
                x : Date.UTC(2011, 4, 5),
                title : 'E',
                text : 'EURUSD: Enter Short on Channel Break'
            }, {
                x : Date.UTC(2011, 4, 6),
                title : 'D',
                text : 'Forex: U.S. Non-Farm Payrolls Expand 244K, U.S. Dollar Rally Cut Short By Risk Appetite'
            }, {
                x : Date.UTC(2011, 4, 6),
                title : 'C',
                text : 'US Dollar: Is This the Long-Awaited Recovery or a Temporary Bounce?'
            }, {
                x : Date.UTC(2011, 4, 9),
                title : 'B',
                text : 'EURUSD: Bearish Trend Change on Tap?'
            },
            {
                x : Date.UTC(2011, 4, 10),
                title : 'A',
                text : 'Test Flag Falling off the chart'                            
            }],
            onSeries : 'dataseries',
            shape : 'circlepin',
            width : 16
        }]
    });
});

});

jquery highcharts highstock
2个回答
1
投票

不幸的是不可能。关于剪切标志的问题在这里报告:https://github.com/highslide-software/highcharts.com/issues/419


0
投票

以下代码可解决问题:

yAxis : {
            title : {
                text : 'Exchange rate'
            },
            max: someBiggerValue, // set max to little higher as biggest data 
        },
© www.soinside.com 2019 - 2024. All rights reserved.