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.
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.
This example case shows a graph with plain nodes in a default style:
This example case shows a graph with nodes in individual, customized styles:
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
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.
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.
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!
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.
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.
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:
The web site this data refers to is the one you are currently reading …
The results of the 2009 Federal Elections in Germany are presented in this example:
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
Imprint / Impressum
© 1997-2013 Dr. Wolfram Schroers. This site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Additional permissions available at http://www.field-theory.org/editorial/index.html.
Wolfram is a leading software engineer focused on Enterprise and B2B apps on iOS. His clients rank from small independent studios to companies in the German DAX index.
He has worked at top Universities on three continents in the past decade and is a popular speaker at conferences. He is currently working in Berlin, Germany, and can be reached at his company website.