2012-08-09 115 views

回答

1

這是循環應該如何:

// draw category labels 
$.each(series, function(serie_index, serie) { 
    renderer.text(
     serie.name, 
     cellLeft + cellPadding, 
     tableTop + (serie_index + 2) * rowHeight - cellPadding 
    ) 
    .css({ 
     fontWeight: 'bold' 
    })  
    .add(); 
}); 

$.each(chart.xAxis[0].categories, function(category_index, category) { 
    cellLeft += colWidth; 

    // Apply the cell text 
    renderer.text(
      category, 
      cellLeft - cellPadding + colWidth, 
      tableTop + rowHeight - cellPadding 
     ) 
     .attr({ 
      align: 'right' 
     }) 
     .css({ 
      fontWeight: 'bold' 
     }) 
     .add(); 

    $.each(series, function(i) { 


     renderer.text(
       Highcharts.numberFormat(series[i].data[category_index].y, valueDecimals) + valueSuffix, 
       cellLeft + colWidth - cellPadding, 
       tableTop + (i + 2) * rowHeight - cellPadding 
      ) 
      .attr({ 
       align: 'right' 
      }) 
      .add(); 

    }); 



}); 

這裏是鏈接:http://jsfiddle.net/pJ3qL/1/

那麼你應該,如果你想再次提請環內對錶格的邊框;)