【问题标题】:highstock: PlotlLines text legend does not work when having 2 x-axeshighstock:当有 2 个 x 轴时,PlotlLines 文本图例不起作用
【发布时间】:2014-05-01 11:01:57
【问题描述】:

我在图表中有 2 个 x 轴,想绘制 2 个 y 轴线。但是,y 轴中绘制线的文本图例打印在图表顶部,而不是打印线的右侧。

这是一个小提琴:

http://jsfiddle.net/joe992005/s48gV/

$(function() {  

    var seriesOptions = [],
        yAxisOptions = [],
        seriesCounter = 0,
        names = ['MSFT', 'AAPL', 'GOOG'],     
        colors = Highcharts.getOptions().colors;

    $.each(names, function(i, name) {

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

            seriesOptions[i] = {
                name: name,             
                data: data
            };

            seriesCounter++;

            if (seriesCounter == names.length) {
                createChart();
            }

        });

    });             

    function createChart() {

  window.chart = new Highcharts.StockChart({     

                      chart: {
                             renderTo : 'container',                 
        },

         yAxis: [{

                plotLines: [{
                    value: 0,
                    width: 2,
                    color: 'silver'
                },{
                    value : 600,
                    color : 'green',
                    dashStyle : 'shortdash',
                    width : 2,
                    label : {

                    align: 'right',
                    y: 12,
                    x: 0,
                        text : 'test bla bla bla 1'
                    }
                }, {
                    value : 250,
                    color : 'red',
                    dashStyle : 'shortdash',
                    width : 2,
                    label : {
                        align: 'left',
                    y: 12,
                    x: 0,
                        text : 'test  bla bla bla 2'
                    }
                }]
            }],


    xAxis: [{

        }, {
              linkedTo: 0
        }],

            series: seriesOptions


    });

    }

});

有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: highstock legend lines axes


    【解决方案1】:

    它看起来像一个错误,在这里向我们的开发人员报告:https://github.com/highslide-software/highcharts.com/issues/3000

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-12-08
      • 1970-01-01
      • 2013-09-18
      • 2019-08-25
      • 1970-01-01
      • 1970-01-01
      • 2018-01-10
      相关资源
      最近更新 更多