2013-09-26 37 views
1

改變字體大小我有一個像下面的圖表上顯示文本。我想改變文字「abc」的字體大小。我嘗試在CSS中放入'font-size':'8px',但它不起作用。有沒有人有這個想法?Highcharts - 文本在圖表上

enter image description here 這裏是小提琴鏈接: http://jsfiddle.net/3hGz2/

  'events': { 
      'load': function() { 
       var label = this['renderer']['label']('* y='+ slope +'x'+'+('+ intercept + ')<br> R^2='+ rSquare) 
       .css({ 
        'width': '150px', 
        'color' : 'grey', 
        'font-size':'8px' 

       }) 
       .attr({ 
        'stroke': 'grey', 
        'stroke-width': 0, 
        'r': 5, 
        'padding': 3      
       }) 
       .add(); 

       label.align(Highcharts.extend(['label']['getBBox()'], { 
        'align': 'right', 
        'x': -110, // offset 
        'verticalAlign': 'bottom', 
        'y': -130 // offset 
       }), null, 'spacingBox'); 

      } 
     } 

回答

1

http://jsfiddle.net/3hGz2/1/

可以作爲fontSize

.css({ 
    'width': '150px', 
    'color' : 'grey', 
    'fontSize':'20px' 
}) 
+0

感謝傑克指定字體大小!! .... –