简体   繁体   中英

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.
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:

....
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>";
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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