2014-05-01 1 views
0

차트에 2 개의 x 축이 있고 2 개의 y 축 선을 표시하려고합니다. 그러나 y 축의 플롯 된 선의 텍스트 범례는 차트 상단에 인쇄되고 플롯 선에는 인쇄되지 않습니다.highstock : 2 개의 x 축을 사용하는 경우 PlotLine 텍스트 범례가 작동하지 않습니다.

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 


    }); 

    } 

}); 

이 사람이 그 날에 도울 수있다 : 여기

는 바이올린입니까?

답변