Paul Carey
Paul Carey

Reputation: 1

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?

Upvotes: 0

Views: 480

Answers (1)

MatejG
MatejG

Reputation: 1423

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

Upvotes: 1

Related Questions