PieChartMorph
Last updated at 1:24 pm UTC on 26 January 2013
A Pie Chart for Squeak
Examples:
pie _ PieChartMorph values: {5. 3. 2. 1. 5. 6. 7. 2. 5. 3. 3}.
pie title: 'a Pie!'.
pie openInWorld

pie _ PieChartMorph values: {350. 320. 250. 150. 200}.
pie openInWorld

pie _ PieChartMorph values: {55. 26. 15. 36}.
pie references: {'A'. 'B'. 'C'. 'D'}.
pie colors: {Color red. Color green. Color blue. Color yellow}.
pie alpha: 0.5 "you have to imagine this: the graphic below looks dark, but it's transparent"
pie openInWorld

TO DO / Wish list:
- improve balloons, they still need work (gm)
- specify borders for each section (dgd)
- be able to slice/offset pie sections (to distinct them from the rest), and reinsert them again (eam)
- feel free to add items here
Fixed items (they come from the previous list):
- improve balloons: titles, values, percentages (gm)
- allow titles for each pie portion. (gm)
- make aPieChartMorph resizable via "Change Size" Halo (seems that some part of it is currently fixed) (fgs)
- accept wheel "from" color (dgd)
- accept a collection of colors (dgd)
- transparent colors (dgd)
- add messages to add new portion dynamically (#add: ) (dgd)
- add Title ala PlotMorph (dgd) (what ala PlotMorph means? (gm))
Users:
I will like to hear of projects who use it, to know if I need to support it or just abandon it ;-) Please link your project here.
Download:
(second release with some internal cleanup)
PieChartMorph-gm.cs
on SqueakMap
Interesting reading? (I still have to read it!)
Building a pie chart morph in Self 4.0, mirrored at these sites:
Related
- PlotMorph
- The tile scriptable Sector morph in Etoys 5 (2012)
Note
Unless you change your color depth from 16 to 32, you might experience some troubles concerning the improper color rendering. This is nothing harmfull but may confuse you so you better change it to 32. (world menu / appearance ... / set display depth ... / 32) (who wrote this???)