Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

The 7 Most Common Chart Mistakes

DZone's Guide to

The 7 Most Common Chart Mistakes

As web devs, sometimes you'll get asked to create charts that show off company data on their site. Read on to get some basic pointers on how best to do this.

· Web Dev Zone
Free Resource

Add user login and MFA to your next project in minutes. Create a free Okta developer account, drop in one of our SDKs to your application and get back to building.

As humans, we like to use patterns in our daily lives, as they allow us to use less energy while processing data and making decisions in a short period of time. However, we are easily influenced by the way patterns are represented. Since many content providers depend heavily on charts to represent data and find patterns, they should be aware that charts could affect the perception of their audience.

To raise awareness about this issue, I summarize the most common chart mistakes in this article.

1. Start With the Origin

Image title

Image title

View interactive chart here

Chart A1 shows a graph increasing in the beginning but decreasing toward the end. This chart could be interpreted as a good sign if it describes the propagation of a disease over time, or a warning if it represents a company’s profit.

Chart A1, however, doesn’t start from zero, it starts from the smallest value of the Y axis. The interpretation of the data could, therefore, be different if the whole chart is presented (see chart B1), your audience will then be less enthusiastic about the disease spreading and it will not stress about their company’s profit.

In that case, a zoom capability of an interactive chart is highly recommended, as it allows the audience to check the chart in different perspectives (see chart B1, click and drag to zoom).

Good practice: Start the chart from the origin, and add a zoom capability if it is possible.

2. Shapes

Image title

Image title

View interactive chart here

The shape and size of elements are perceived in relation to each other. Chart A2 creates the illusion that the element at the top is the smallest one due to its position on the top of a cone. Your audience has to read the value of each element to be able to interpret the data, whereas chart B2 shows the values of each element without any confusion.

Good practice: avoid using shapes, unless you have a good reason.

3. Maps

$(function () {

    // Prepare demo data
    var data = [
        {
            "hc-key": "ca-5682",
            color:"red",
        },
        {
            "hc-key": "ca-bc",
            "value": 1
        },
        {
            "hc-key": "ca-nu",
            "color": "green"
        },
        {
            "hc-key": "ca-nt",
            "color": "green"
        },
        {
            "hc-key": "ca-ab",
            "value": 4
        },
        {
            "hc-key": "ca-nl",
            "value": 5
        },
        {
            "hc-key": "ca-sk",
            "value": 6
        },
        {
            "hc-key": "ca-mb",
            "value": 7
        },
        {
            "hc-key": "ca-qc",
            "value": 8
        },
        {
            "hc-key": "ca-on",
            "value": 9
        },
        {
            "hc-key": "ca-nb",
            "value": 10
        },
        {
            "hc-key": "ca-ns",
            "value": 11
        },
        {
            "hc-key": "ca-pe",
            "value": 12
        },
        {
            "hc-key": "ca-yt",
        }
    ];

    $('#container').highcharts('Map', {

        title : {
            text : 'B1 : Map'
        },

        legend : {
            enabled: false
        },


        series : [{
            data : data,
            mapData: Highcharts.maps['countries/ca/ca-all'],
            joinBy: 'hc-key',
            name: 'Province',
            states: {
                hover: {
                    color: '#BADA55'
                }
            },
            dataLabels: {
                enabled: true,
                format: '{point.name}'
            },
            tooltip: {
                useHTML: true,
                headerFormat: 'Name of the province:<br/>',
                pointFormat: '<b>{point.name} </b>',
            },
        }, {
            type:'pie',
            name: 'Canadian demographics',
           center: ["75%", "18%"],
            size: 100,
            innerSize: '50%',
            tooltip: {
                valueSuffix: '%',
                useHTML: true,
                headerFormat: '<b>{series.name}</b><br/>',
                pointFormat: '{point.name}: {point.y}',
            },
            data: [{name:"Non Aboriginal population",y:95}, 
                   {name:"Aboriginal population",y:5, color:'green'}],
            dataLabels: {
                enabled: true
            }
        }]
    });

});

Image title

View interactive chart here

The green color on the map shows the parts of Canada where aboriginal people are demographically the majority, the green part represents 34.5% of the national area.

The map could easily deceive your audience when it comes to the demographic percentage of aboriginal people, as your audience could guess the number of the demographic percentage based only on the green area, i.e. the Aboriginal population owns the biggest territory so their number is significant in Canada. The circular chart, in the upper corner, however, shows both the green area and the demographic number leaving no room, for any misinterpretation.

Good practice: Always support your maps with information to prevent your audience from assuming the missing information.

4. Cumulative Chart

Image title

Image title

View interactive chart here

Cumulative charts are the most confusing charts since it is very easy to misinterpret the data and miss details. On chart A4, it is difficult to see the low values on May 15 and July 15; however, this is not the case on chart B4 where there is no data accumulation. If you must use a cumulative chart, consider to also show a non-cumulative chart for the same data.

Good practice: for more clarity, use data in a cumulative and a non-cumulative chart.

5. Conventions

Image title

Image title

View interactive chart here.

Conventions are different from one culture to another. The following charts have the same data but target different audiences. In North America, I will go with chart A5, because reading from left to right is the convention; however, I will use chart B5 for the Middle East, as people in that area read from right to left.

Good practice: Know your audience to set up more effective charts.

6. Illusion of 3D Charts

Image title

Image title

View interactive chart here.

Chart A6 makes it difficult to see the difference between the values on Oct 14, Jan 15 and Apr 15, due to the curvature of the 3D top part of the column. I have to admit that even with 2D charts (see chart B6), the comparison of the three values is tricky, as they are close to each other numerically. Nevertheless, it is much better than the 3D chart especially when the values are exposed on the top of the columns.

Good practice: 3D is cool, but 2D is easier to understand.

7. Too Much Data in One Chart

Image title

View interactive chart here.

This chart shows that too much information kills information. Most people start to make irrational decisions when presented with too much information at the same time.

Good practice: reduce the amount of data in your chart as much as possible.

Conclusion

Charts are part of our daily lives, and they have a great influence on our decision-making process. To avoid misunderstandings and wrong assumptions, be sure to show the necessary data, to use the right shapes, and to know your audience.

Launch your application faster with Okta’s user management API. Register today for the free forever developer edition!

Topics:
web dev ,data visaulization ,javascript

Published at DZone with permission of Mustapha Mekhatria. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}