简体   繁体   English

更改浮动饼图字体大小

[英]change flot pie chart font size

I'm trying to increase the label font size in a piece of existing code. 我正在尝试在一段现有代码中增加标签字体的大小。 I know it should be through the Label Formatter but for the life of me can't fathom how to do it. 我知道应该通过Label Formatter,但是对我而言,我一生都无法理解该如何做。
Existing code 现有代码

....
label: {
     show: true,
     radius 3/4,
     formatter: labelFormatter,
     background: {
          opacity: 0.0
          color: '#000'
     }
 }
 .......

Can somebody point me in the right direction? 有人可以指出我正确的方向吗?

You can add custom function as your label formater and change font size there with CSS like this: 您可以将自定义函数添加为标签格式器,并使用CSS在此处更改字体大小,如下所示:

....
label: {
     show: true,
     radius 3/4,
     formatter: labelFormatter,
     background: {
          opacity: 0.0
          color: '#000'
     }
 }
 .......

function labelFormatter(label, series) {
    return "<span style='font-size:10px'>"+label+" "+series+"</span>";
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM