SharpPlot Tutorials > Chart Samples

Chart Samples

This section shows typical usages of the different chart types supported by SharpPlot.

Each of the following tutorials has a set of four examples showing how a particular chart type can be used.

Bar charts for small series
The Barchart is probably the simplest and most commonly used graphic on the web. It is an ideal format for presenting summary data in multiple categories, and often works much better than a Piechart if the object is to allow the reader to compare values easily.
Box-and-Whisker plots for multivariate data
A selection of simple Box-and-Whisker charts are developed here, all using a ‘classic’ dataset from the 1930s showing barley yields at various farms in Canada. The trials were made at 6 farms over 2 years, with 10 varieties of barley, giving 120 data-points in total. The entier dataset can be found here.
Bubble charts for discrete XYZ data
This tutorial builds four simple examples of bubble-charts, showing how the markers scale to represent an extra dimension in the data. Regression models may be used with the bubble-chart – naturally the area of the bubble weights the model-fit appropriately. User-defined markers can be used to good effect also, as the final example illustrates.
Cloud charts for discrete XYZ data with perspective
The CloudChart or XYZ Scatter is a surprisingly versatile method for diagramming data in 3 dimensions. The four examples shown here illustrate a few of the possibilities.
Contour plots for XYZ interpolation
Contour plots offer a 2-dimensional alternative to CloudCharts when it is necessary to visualize ‘height’ data in addition to x and y values. The data may be geographic (rainfall totals from a number of weather stations) or simply a model of 3 variables (house prices as a function of the age of the property and its floor area).
Dials and Gauges for isolated numbers
The Dial chart is the only charttype in SharpPlot which typically takes a single number, rather than an array. It is possible to use charts like the XBarchart to imitate thermometers and other simple gauges, but the Dial has the benefit of showing some of the context of the data with warning zones, datum lines and other cues.
Gantt charts for timewise bars
The Gantt chart was originally developed as a good way to represent activities across time, and was popularised by tools such as Microsoft Project. It may be used in a variety of planning scenarios, or simply to show the status of some activity or piece of machinery across time (say machine performance across the day).
Histograms for distributions
All the examples which follow use the same set of values – the sum of three dice, thrown repeatedly. Clearly the range will vary from 3 to 18, with the more likely values falling in the middle.
Line graphs and Time series
Although it is called ‘Linegraph’ this SharpPlot method can do markers, risers from the X-axis, filled surfaces and so on, in any combination. Typically it is used for timeseries data, but of course it can also draw any continuous curve when given x as well as y co-ordinates.
Min-Max or Hi-Lo charts
This chart is often used in combination with a LineGraph or ScatterPlot to show range in addition to daily values. The first example creates a typical ‘High-Low-Close’ chart from daily share price information, and the second shows how errorbars can be added to a scatterplot of experimental data. However, it can be used on its own, for example to show the span of frost-free days across the year as a timeseries.
Multiples for small thumbnails
One of the best innovations in Tufte’s “The Visual Display of Quantitative Information” is the idea of using an array of miniature charts to display multi-dimensional data. Often a series of values are recorded at (say) several sites or on several days, then are superimposed on a single chart as a collection of dotted and dashed lines in various colors. This often makes it very hard to see the patterns and relationships in the data.
Network Map for nodes and links
The Network Map offers the ability to display a list of nodes and all their mutual links. The DrawNetworkMap help page demonstrates that flat links are suited for an unoriented dense network on the default (circular) layout. Let’s explore a few more uses of network maps.
Pie charts and Rose diagrams
Piecharts are best used with a small number of data items where the values represent some part of a total. Typically the numbers will be percentages, and the sector values will differ significantly. If it is important for the user to be able to compare values accurately, a simple Barchart is almost always a better choice.
Polar and Radar charts
The ‘Radar’ chart is logically similar to a Barchart, in that the given data is arranged at equal intervals. The difference is that the Radar chart arranges the values around a circle at equal angles, which is often a good way of comparing several sets of performance indicators.
Response surfaces
The response surface is generally used with computed data to show a mathematical function of two variables. It may be combined with other 3D charts (typically the cloud chart) to show a theoretical fit in addition to the raw data plotted in 3 dimensions.
Scatter plots for discrete XY data
The scatterplot (or scatter diagram) is almost always the first step in analysing any collection of data. Typically you are trying ti isolate one or more causes, in the attempt to predict some effect. These examples all use some data on house-prices, with the idea of being able to predict the price of any house given its type and floor area.
Step charts for discontinuous data
Step charts are used for two main chart-types. They are a very convenient way of plotting a timeseries where there may be an instantaneous change between values, which then stay fixed for some time – government interest-rates are typical. Filled stepcharts work well in combination with Barcharts, and they can also be used instead of the Histogram where data has been aggregated into categories of varying widths.
Tabulating data
SharpPlot can tabulate as well as chart, but please be aware that these tables are not designed to display large amounts of complex data. They are for summaries and simple CrossTabs where a limited amount of data can be used to augment a complex chart. The examples show a table used as a chart in its own right, and some simple summaries and groupings added as ‘notes’ to typical timeseries data.
Tower charts for 3D bars
Towercharts are good for visual impact, but are rarely an effective way to present numbers where the values are important. These examples parallel some of the examples in the tutorial on tables, as a Towerchart is really just a simple way to present a two-way tabulation in visual form.
Trace charts for multiple series
Trace charts (or ECG plots) are often a convenient way to add an extra dimension to a two-dimensional chart. They are similar in principle to the small multiple, but save a lot of redundant ink when all the series share the same X-axis. Trace-charts are also used as a simple way to draw Kite Diagrams, which are a common graphical tool for botanical field studies.
Triangle plots for 3-way proportions
The Triangle chart is used to analyse data where there are three important constituents, summing to unity. It is common in Geology and Chemical Engineering where a set of 3 key ingredients determines the outcome from some process.
Vector fields and directed graphs
This style of plot can be used in two very different ways, to show either directed graphs, or to plot vector fields as a scatter diagram. The examples illustrate both of these.
Venn diagrams
Venn diagrams are used to summarise set membership information. SharpPlot will draw a proportional diagram for two sets (and one intersection) but for the three set case the chart is purely diagrammatic, as it is impossible to scale all the regions in the correct proportion. Diagrams for higher numbers of sets are not supported.
X Bar charts for positioned bars
Barcharts are usually drawn with a ‘logical’ X-axis. However there are times when you want to represent discrete values which occur at particular times. the XBarchart allows you to place bars exactly where you want them, and also to override the normal width for each bar.

Send comments on this topic
© Dyalog Ltd 2016