Exercise: Bar Charting with Horizontal vs. Vertical Data

Best Practices

Overview

To create data visualizations in the WCMS, you must ensure that the source data are properly formatted.  This document provides guidelines on data formatting.  It is intended for data owners and WCMS web developers.

Note:  The examples presented in this documented are in CSV format, but the same principles apply to JSON-formatted data.

Deep vs. Wide Data Formatting

The Advantages of Deep Formatting

xxx

Data Maintenance

xxx

Flexibility

xxx

Filter Controls

You may need to offer your end users the option of filtering a visualization, such as the bar chart on the right, which is filterable by X.  (See also map with filter control.)  To set up a filter control in the WCMS, you must ensure that the filterable values are in a single column.  Consider the following map data on the left.  It includes values for both males and females.  To offer end users the option of filtering the visualization by sex, we would need to reformat this data.  Without such a filtering option, you would need two maps if you want to visualize the data for both males and females.

xxx

Note: If the need is to visualize only male data or only female data, the source file would work fine. There’s no need to remove data, but generally, you should avoid the wide formatting on the left so that you have more flexibility in using and reusing the data.

Other Considerations

Working with Confidence Intervals

xxx

Visualizations that Require Specific Formats

xxx