Data Visualization: Presenting Multiple Metrics (from a Single Data Source)

Best Practices

About This Document

At times multiple metrics may be available from the same source dataset, for example:

  • Total Cases and Cases per 100K, by Year
  • Cases per 100K and Program Costs ($), by State

This document explores four solutions for presenting multiple metric series from the same source file.  For simplicity, each example involves two metrics series, but in practice you may see source files with three or more metrics. This document is intended for developers working with the CDC Open Visualization Editor (COVE), as well as data owners, analysts, and managers who are assessing ways to present data in COVE.

(Note: This document is a supplement to Defining Data for Visualization, which we suggest as a starting point if you are new to data visualization with COVE.)

Separate Visualizations

In many cases it is best to present each metric series in a separate visualization.  This is especially true when (1) public health communications require different visualization types; (2) each metric is key to public health messaging; and/or (3) the metrics require different presentation formatting in COVE (such as different rounding values or prefixes).

For maps and the basic chart types (bar, line, combo, pie), you can use the same source file for multiple visualizations, but each metric needs its own column in the source file, as illustrated below. (Note that this is an example where the metrics use different presentation formats:  the values in the chart on the right are prefixed with dollar signs, unlike the values on the left.)

Two metrics in same source file visualized in separate charts

Ignoring metric columns:  If you’re building a chart — line, bar, or combo — and the source dataset has metrics you do not plan to use, you may have to specify columns to be ignored.  This “ignore” option, when applicable based on the source structure and content, displays on the Import Data tab. (For maps, you define only the metrics to be used; there is no need to specify columns to be ignored.)

Single Visualization with Filter by Metric Type

You can also present multiple metrics in a single visualization with a filter control on the metric type.  This solution works best if the metrics are different views of essentially the same information (such as Cases per 100K and Total Cases) and require the same presentation format.

Chart and source data with multiple metrics and multiple legend categories

With charts, each metric series can have its own column in the source file, as illustrated above.

With map data, all metric values must be formatted as a single series of data, as illustrated below.  For this example, a filter control would be created on the column Metric Type. (For more information on filtering, see the topic “Setting Up Filter Controls” in Defining Data for Visualization.)

Source data with two metrics -- total cases and cases per 100K -- in the same column

Tips for working with metric filters:

  • If there are slight variances in the numeric formatting or handling (for example, the values of only one metric series are to be rounded) and you want to present the data in a single visualization, some or all numeric formatting may need to be handled in the source data before the file is uploaded to COVE.
  • COVE does not currently support dynamic text based on the filter selection. For example, you cannot set the legend title to change when the user switches the metric. Take this limitation into consideration when deciding on visualization titles and other text.

Exercise:  Metric Filter Controls.  This exercise takes you through the building of a chart with a filter control on metric type.  The metrics are formatted as separate columns in the source file.  [need to discuss whether this exercise is needed — I could just summarize how this works]

Single Visualization with Secondary Metrics in Tooltips/Table

When a metric series is not key to the public health messaging, the content owner may choose to present it as supplemental information in tooltips or the supporting data table.  This solution works well with maps and simple charts. Currently this solution does not work with charts that have multiple data series (i.e., multiple categories in the legend).

Source data with 2 metrics with only one visualized and other in pop-up

Combo Chart with Two Value Axes

If the goal is to show the correlation between two metric series (or lack of correlation) in chart data, you can create a combo chart with two value axes. The flexibility of the combo chart allows you to present the series with different formatting and handling requirements, even different series styling.  In the example below, the left-axis numbers are formatted as dollar figures, unlike the right-axis series. Also, the left-axis series is presented as bars while the right-axis series is a line.

[Need to replace image below.  Chart dates are not sequential!]

Screen capture of source dataset with two metrics and resulting combo chart

Exercise:  Combo Chart with Dual Value Axes.  This exercise takes you through the building of a combo chart like the one above. You learn how to stylize and format each data series and each value axis separately. [link to come]