TransWikia.com

Why does pgf-pie create so many "Missing character: There is no b in font nullfont!" errors?

TeX - LaTeX Asked on September 5, 2021

I am trying out pgf-pie and even simple examples seem to have some bug, because I get lots of Missing character: There is no b in font nullfont! errors and if I put all errors one after each other, they read blue!60blue!60,cyan!60,yellow!60..., so it must be something with the standard color definition in pgf-pie.

I am using Package: pgf-pie 2011/10/02 v0.2, has this maybe been fixed in later versions?

This is an MWE that leads to the given issue:

documentclass{standalone}
usepackage{pgf-pie}

begin{document}

begin{tikzpicture}[every label/.style={black}, nodes={white}]
  pie {10/A, 20/B, 30/C, 10/D, 10/E, 10/F, 10/G}
  pie[pos={8,0}, square] {23/A, 27/B, 17/C, 13/D, 20/E}
  pie[pos={2,-8}, cloud] {10/A, 20/B, 30/C, 20/D, 20/E}
end{tikzpicture}
end{document}

2 Answers

you can try the following. But I didn't checked very thoroughly the code, so perhaps the thecolor has function that I missed

documentclass{standalone}
usepackage{pgf-pie}
makeatletter
renewcommand{pgfpie@findColor}[1]
{
  pgfmathparse{int(mod(#1,value{pgfpie@colorLength}))}
  letcipgfmathresult
  foreach c [count=j from 0] in pgfpie@color {
    ifnum j=ci
    xdefthecolor{c}
    %thecolor %removed 
    breakforeach
    fi
  }
}
makeatother

begin{document}

begin{tikzpicture}[every label/.style={black}, nodes={white}]
  pie {10/A, 20/B, 30/C, 10/D, 10/E, 10/F, 10/G}
  pie[pos={8,0}, square] {23/A, 27/B, 17/C, 13/D, 20/E}
  pie[pos={2,-8}, cloud] {10/A, 20/B, 30/C, 20/D, 20/E}
end{tikzpicture}
end{document}

Correct answer by Ulrike Fischer on September 5, 2021

With etoolbox -- https://tex.stackexchange.com/a/130985/197451

enter image description here

documentclass{standalone}
usepackage{pgf-pie,etoolbox}

begin{document}

begin{tikzpicture}[scale=0.9]
pie[pos={0,0},
    /tikz/every pin/.style={align=center},
    every only number node/.style={text=white},
    text=pin,
    rotate=240,
    explode=0.2,
    color={blue!70,cyan!70,red!70,orange!50}
    ]{10/A, 20/B, 30/C, 10/D, 10/E, 10/F, 10/G}

pie[pos={0,-9cm},square,
     /tikz/every pin/.style={align=center},
     every only number node/.style={text=white},
     text=pin,
     rotate=240,
     explode=0.2,
     color={blue!70,cyan!70,red!70,orange!50}
     ]{23/A, 27/B, 17/C, 13/D, 20/E}

pie[pos={0,-15cm},cloud,
     /tikz/every pin/.style={align=center},
     every only number node/.style={text=white},
     text=pin,
     rotate=240,
     explode=0.2,
     color={blue!70,cyan!70,red!70,orange!50}
     ]{10/A, 20/B, 30/C, 20/D, 20/E}

end{tikzpicture}
end{document}

Answered by js bibra on September 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP