Highcharts - 更改图表上文字的字体大小 [英] Highcharts - change font size of text on chart

查看:2722
本文介绍了Highcharts - 更改图表上文字的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面的图表上显示文字。我想更改文字abc的字体大小。我尝试在CSS中放入'font-size':'8px',但它不起作用。有没有人对此有所了解?

I have text on a chart like below. I want to change the font size of the text "abc". I tried putting 'font-size':'8px' inside of the css, but it did not work. Does anyone have an idea about this?


这里是小提琴链接:
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');

           }
       }


推荐答案

请参阅 http://jsfiddle.net/3hGz2/1/

您可以指定字体大小为 fontSize

you can specify the font size as fontSize

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

这篇关于Highcharts - 更改图表上文字的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆