the blog of wolfram schroers

PowerPlot: Business reporting examples

This article contains a listing of further examples on the PowerPlot homepage. The examples demonstrate a few more advanced use cases that add on to the charts generated by the default factory methods. You can also read a basic step-by-step tutorial and an overview of the design of PowerPlot.

Table of contents:

Data charts
Bar charts


Graphs are a type of chart that consist of nodes and connections. When drawing a chart of a graph, the nodes typically are represented by boxes and the connections by lines. In PowerPlot, connections can be non-directed, unidirectional or even bidirectional. Graphs are represented by the WSGraph class, a subclass of WSData. While the nodes are an array with index numbers, the connections are represented by a set of unique objects with no indices associated with them.

In addition to representing graphs, an instance of WSGraph has the means to evaluate and compute properties of the graph like incoming and outgoing connections and their strength.

A graph with plain nodes

This example case shows a graph with plain nodes in a default style:

Business model graph

A graph with customized nodes

This example case shows a graph with nodes in individual, customized styles:

Value creation model graph

Note that the individual style properties (like the node sizes, colors and fonts) are stored in the customDatum property of a WSNode which is inherited from its WSDatum superclass. In this situation, the customDatum slot retains an instance of WSNodeProperties.

Data charts

Data charts are used in a variety of scientific applications. If done well they present even complex information comprehensibly and clearly. PowerPlot allows to customize data charts with a wide variety of options.

Data with uncertainties

This example contains a complete customization of a data chart of class WSData. The complete customization shows off the available options developers can choose from to let their charts appear specifically as they require.

Scientific data example

A scatter plot with density lines

The next example contains multiple plot elements: The coordinate axis (class WSPlotAxis), two contour plots (based on the WSPlotRegion classes) and a set of points (done with the standard WSPlotData class). Note how in this case the ordering of the WSPlotController objects in the WSChart really matters!

Scatter plot with contours

Actual scientific data

As the final data plot, this example shows off actual scientific data taken from Phys.Rev. D82:094592, 2010. The chart has a coordinate axis of class WSPlotAxis, a gray-shaded error band (done with a WSPlotRegion), a best fit line (a customized WSPlotData) and the actual data points on top of it all (again, another WSPlotData object). Again, the order of these elements matter.

Real scientific data example

Bar charts

Bar charts are a very common type of chart in the business world. Bars can be individually customized or drawn in a unified style. Bars can also be combined in a chart forming either “stacked” or “displaced” bar charts.

Web traffic as a bar chart

When considering monthly hit rates to websites, one usually has different metrics: the total number of “hits” (accesses to files), the number of “page views” (all files on a page are loaded) and the number of “unique visitors” (distinguishable people accessing multiple pages on the site).

It makes sense to combine these metrics in a single bar chart as a function of time. This has been done in this example:

Web traffic

The web site this data refers to is the one you are currently reading …

Election results

The results of the 2009 Federal Elections in Germany are presented in this example:

German Federal Elections 2009

A particular feature is the individual color scheme of each bar — this is a common way to distinguish the individual parties easily. Again, this is done using the customDatum slot of WSDatum. This time, the object stored in this slot is of class WSBarProperties. Note how Objective-C is a fully dynamic language and how we can easily pick different style classes for one slot in WSDatum!

US Failed banks 2000–2010

The idea of such an amusing example is from Ray Wenderlich's tutorial on Core Data. Apart from the topic, the chart is a very simple example of a bar chart with no particular bells and whistles.

Failed banks in the US