The function (and the toolkit) must provide control for:
- size of pie slices (this will be the value or %)
- color of pie slices (this is REQUIRED)
- overall size of pie chart
- label values, font style, font size
The number of pie slices will vary.
You can write it to accept the json data as parameters, or as defined variables inside the function with the json data being output in place by php
You may use a free or paid toolkit. One we like is "jqplot". However, we have not seen that you can control the pie slice color.
If you know the zend framework well and are good with front end (UI/UX), then there will be more work to follow.