Historically, we have been very picky about what chart types we include in Chartio. For our customer use cases, we value clear ways of displaying information through charts that provide valuable insights and have good default values, while also allowing options for individual customization. Today, we are excited to announce the introduction of a new, often-requested chart type to Chartio: the sparkline. Read on to learn more about what this chart type is used for and how you can use it to gain insights into your data.
What is a sparkline?
The sparkline can be considered a sibling to the common line chart. Rather than plotting multiple lines on a single set of axes, a sparkline consists of one or more line charts in a vertical stack. Each subplot has been reduced to its core elements – sometimes just the line – to emphasize patterns in change of value.
The example sparkline chart above shows weekly revenue for various shops in a fictional chain of drink stands. It has been set to have a different vertical range for each subplot, and markings to note the starting and end values as an idea of the range of values for each store. From this plot, we can observe different patterns for each store. The Cherry St., Oak Ct., and Pine St. locations all show growth over the six-month period, though it is much less for the Pine St. location. The Ash St. location seems to have had a temporary bump through June, but was steady otherwise. The Redwood Rd. location had a fair bump at the start, but has fallen to a somewhat low baseline.
It’s worth noting that the implementation of sparklines in Chartio differs somewhat from its original specification. Edward Tufte coined the sparkline name to describe small, typically unlabeled charts built to be placed inline with text. His intent was to say that small charts like sparklines can still provide useful contextual information as it is needed in a compact way. Chartio’s sparklines chart type serves that goal in a way that is easily accessible.
When you should use a sparkline
Like the line chart, a sparkline is great for showing how values change over time. The sparkline can serve as a useful alternative to the line chart when multiple lines need to be plotted.
On one extreme, the sparkline is a good choice when there is a lot of overlap between lines that cause them to be difficult to distinguish from one another.
At the other extreme, sparklines are a good choice when there is no overlap between lines due to them covering broadly different ranges. This often pops up when you have multiple metrics that you want to track at the same time. Plotting all of the lines on a single line chart can hide changes in values for metrics at different scales. Associating lines to scales on a multi-axis plot can be confusing. Sparklines overcome both of these issues by allowing each metric its own vertical scale while maintaining alignment in horizontal positions. Simply plotting multiple line charts, one for each metric, does not guarantee full alignment, and can waste space through repeated labeling of the horizontal axis values for each chart.
Of course, the sparkline also has its own tradeoffs to consider. Since each subplot in a sparkline tends to be very narrow vertically, we are limited in how much information we can show for each line. Typically, we lack markings for the vertical range of the data in each subplot, and only note the start and end values for reference. Because of this, it’s important to realize that sparklines are built to emphasize patterns in relative changes, rather than absolute changes.
Creating a sparkline in Chartio
Creation of a sparkline chart in Chartio is just as easy as creating a line chart – in fact, the same data format used to produce a line chart in Chartio can also create a sparkline.
The first column of data should correspond to horizontal axis values, often timestamps. Each column afterwards specifies one subplot in the sparkline, and the vertical value taken at each horizontal point. This may require some reordering of columns and a pivot data operation. All that’s left to do from there is to select the appropriate icon to get your desired chart.
Sparklines are an exciting new chart type that expands Chartio’s ability to make data insights available to all. If you’ve got any feedback or suggestions for feature improvements, let us know at support@chartio.com.