Add some documentation
Simplify drawing parameter calculations
Implement reasonable behavior for pie charts with nil palettes