In the
pie documentation, it states:
formatter: This function specifies how the positioned labels should be formatted,
and is applied after the legend's labelFormatter function.
However, when inspecting the label you would find the following:
<div class="label-formatter" style="color:white"> <!-- pie label format -->
<div class="label-formatter" style="color:red">Label</div> <!-- legend format -->
</div>
The color style from the legend is overriding the color style from the label.
The jsfiddle sample demonstrates this behavior. It also demonstrates the .pieLabel CSS style being overridden. I only mention this because the documentation also lists this as a way to style labels.
I would suggest that this is a bug, or at least that the pie documentation is not accurately worded. The label style is being applied before the legend style, not after.
I suggest creating a new issue and see how flot's maintainer responds.
In the meantime, I think you can modify jquery.flot.pie.js. In the drawLabel function, modify this code:
if (lf) {
text = lf(slice.label, slice);
} else {
text = slice.label;
}
if (plf) {
text = plf(text, slice);
}
Change it to this:
text = slice.label;
// Apply the pie formatter
if (plf) {
text = plf(text, slice);
}
// Apply the labelFormatter, you can leave this out completely if you don't want any style from the legend
if (lf) {
text = lf(slice.label, slice);
}