0

我在向 highchart 样条中添加新行时遇到问题。我想要一条不同颜色的第二行,这可能吗?

http://jsfiddle.net/gc9n/uBxmz/1

 load: function ()
  {    
    var series1 = this.series[0];
    var series2 = this.series[1];
    setInterval(function () {   
    var x = (new Date()).getTime(), // current time    
        y = Math.random() ; 
        c = Math.random();
    series1.addPoint([x, y], true, true);   
    series2.addPoint([x, c], true, true);   
    chart.redraw()
    }, 700); 
4

1 回答 1

0

请在部分代码下方更改您

   series: [{   
   name: ' Speed',       
   data: (function () {       
   var data = [],time = (new Date()).getTime(), i;        

   for (i = -19; i <= 0; i++) {    
   data.push({x: time + i * 1000,y:44});       
   }    
   return data;  
   })() },
   {
   name:'Second Series',
   data: // Add your data here
   }

  ] 
于 2013-04-21T11:45:24.583 回答