Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Simplify and Enhance Your Reporting with Character-based Bar Charts : Page 4

Numerous software packages and programming languages have built-in capabilities for producing text-based bar charts by making use of either ASCII or UNICODE characters. Because these bar graphs are nothing more than text characters themselves, you don't need any special third-party software to create them. Consequently, you can incorporate such graphs easily and at virtually no cost anywhere you need to present tabular data.


advertisement
Examples
Here's a handful of sample examples that may help illustrate the potential of this method. Email Example. Figure 2 illustrates the cola example applied in an email situation. In this case, the chart was hand-typed into a Microsoft Outlook email using Arial font and repeating the Unicode block character 9608.

Figure 2. A hypothetical rich-text email for the cola example.
Microsoft SQL Server Example. Figure 3 might be a typical query where thousands of products in a large organization are offerred and a database manager would like to scan visually for outlying observations to ensure data integrity in the underlying database (of course, in reality, simply computing standardized z-scores and selecting them out would be more probable). An additional application might be for, if the final output is not a query, but a data-driven Web page, this "chart" gets simply passed into the Web page as a string, saving the Web server precious resources. (Note: if using unicode characters in a Web page, the meta tag <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> should always be used within the <head> section of the page)
Figure 3. Bar charts added to a tabular SQL query help identify outlying observations in a glance.
Microsoft Excel Example. Figure 4 depicts a classic application of how this general method can be most valuable. Typically, users create Excel chart objects to visually represent their data. While Excel charts are very powerful, they can also be bulky and require considerable effort to arrange "just right" within the worksheet at the intended location. However, by using Excel's =REPT() function to repeat characters, you can treat a single cell like a stand-alone bar chart. In fact, you can refer to an adjacent cell in the formula to control how many characters to display, thus making the chart highly dynamic.

Figure 4. Two charts sized dynamically in Excel based on adjacent cell values eliminate the heavy overhead or hassle of Excel's chart objects.
Java Example. Figure 5 shows a sample dialog box that might appear within a Java application or applet on a Web page. Again, the idea is highly extensible to most any type of situation wherein data is summarized and presented