=for advent_year 2010 =for advent_day 18 =for advent_title On the 2nd day of Xmas Santa hits the bar pretty hard! =for advent_author Adam Russell =begin eds Re: the ordinal in the title, A begins on the 25th and runs though Epiphany. =end eds Santa is truly a big picture guy. He prefers to get a sense of data quickly to make the important executive decisions, so the P<2010-16|NMS> needs to be able to provide a summary of the available data. Nick also gets increasingly impatient as the big day fast approaches, and yearns for figures on how the tallies of who has been naughty and nice are shaping up in order to place the final just-in-time toy orders As very straightforward module without much mystery to it, M fits the bill nicely. Even Santa's most junior elf can whip up a small bit of code to query the NMS and produce an easy to decipher ASCII-art chart. The naughty nice tally is an ongoing work with data being fed constantly into a database from around the world. Since this reporter has been sworn to secrecy concerning this most valuable of data stores, the sample code below contains only some static sample data reflecting a recent snapshot. unknown (129398430) *********
naughty (233314664) *****************
   nice (456089984) *********************************
Using M is as simple as constructing a hash for your data and passing your BarGraph object's C method a reference to it. You can also A<#mod18.pl.13|change the graphing character>, A<#mod18.pl.16|sort records>, and set the max data value to A<#mod18.pl.15|scale the chart width>, among other adjustments. Perhaps of most use is the ability to display the graph bars in color—in segments as wide as 25% of the maximum width of the graph—if P<2004-02|Term::ANSIColor> is available =sourcedcode mod18.pl =cut