DPL Example 102
From FollowTheScore
back to list of examples
Create a pie chart based on DPL query
We show the 10 most popular articles
{{#ploticus: #proc getdata data: "Alpha" 100 "Beta" 200 "Gamma" 300 // render pie graph #proc pie datafield: 2 labelfmtstring: @@1\n@@2\n@@PCT% labelmode: line+label outlinedetails: color=blue center: 3 3 radius: 1.1 colors: dullyellow drabgreen pink powderblue lavender labelfarout: 1.2 explode: 0 0.2 0 0 }}
The above script produces the following output:
{{#ploticus:
- proc getdata
data:
"A1" 100 "Abc/def" 100 "A ECP-00055 test page" 100 "Article with underscore" 100 "Activity Page 1" 100 "Activity Page 2" 100 "A2" 100 "Aa" 100 "Annotation URI" 100 "An article which is only referenced by a DPL query" 100
// render pie graph
- proc pie
datafield: 2 labelfmtstring: @@1 (@@2) labelmode: line+label outlinedetails: color=blue center: 4 4 radius: 1.6 colors: dullyellow drabgreen pink powderblue lavender labelfarout: 1.8 }}