For week 24 of #WOW2022, Luke Stanke invites us to build an Arctic Ice Extent Horizon Chart: The amount of ice in the Arctic Ice Sheet.

If you haven’t seen horizon charts before, you’re probably wondering how do you read this chart? However, once you understand how the data is displayed, you will find that it is a very effective way of displaying trend data in a small space.

What is a horizon chart?

Horizon charts are an alternative to ridgeline charts and small-multiple area charts, allowing greater precision for vertical space through the use of colored bands. These charts are very useful to easily detect general trends and identify extreme values.

In other words, you can say that a horizon chart is a compact version of an area chart, where you take an area chart and divide or slice it into equal horizontal intervals and then collapse each of those individual bands, in the same band, which makes the chart more compact and similar to a heat map.

The main requirements of the challenge are:

  • Normalize arctic ice (NH) to work between the ice extent between the minimum and maximum values presented.
  • Create a horizon chart displaying 5 level values (0 to 0.2, 0.2 to 0.4, 0.4 to 0.6, 0-6 to 0.8, 0.8 to 1.0
  • Show only from the 1990s to today
  • Partition the data by decade and on the x-axis the data should be shown by day.

An implicit requirement that I detected when trying to understand Luke’s chart and that I consider to be very important to solve the challenge, is that we must consider that the red bands must be handled on an inverted axis.

We know that Luke’s challenges are never without tricks and this one could not be the exception, since the challenge requires the construction of an interesting variant of a horizontal chart, since we must solve how to keep the axis inverted in the horizontal chart when collapsing all 5 levels.

Here I share a visual example of what we are looking for.

Note: The 40%-60% band is presented in white, which allows us to focus on the other 4 bands in the final chart, that is, the blue and red colors.

Here are the steps I followed:

STEP 1. FILTER THE DATA BASED ON THE YEAR.

In my case, I applied the filter when creating the extract to use data from the year 1990 onwards.

STEP 2. CALCULATE THE DECADE FIELD.

Decade STR(INT([Year] / 10)) + “0’s”

STEP 3. CREATE A STANDARD AXIS TO PRESENT THE DATA BY DAYS.

What is sought with this formula is to build an axis where the dates belong to a single decade, in this case select the 2020s.

To calculate the new date, 1/1/2020 will be considered as the base date and the days of difference of each date with respect to the start date of the decade to which it belongs will be added to this date.

Axis DateDATE(DATEADD(“day”, [Date] – MAKEDATE(INT([Year] / 10) * 10, 1, 1), MAKEDATE(2020, 1, 1)))

STEP 4. NORMALIZE THE ARCTIC ICE (NH) TO WORK BETWEEN THE ICE EXTENSION BETWEEN THE MINIMUM AND MAXIMUM VALUES PRESENTED.

The result of this formula will give us a scale from 0 to 1.

NHN(NH – { MIN(NH) }) / ({ MAX(NH) } – { MIN(NH) })

At this point I clarify that seeing the final charts of Luke and mine, there are some differences in the colors and I think that it may be caused by some additional requirement that Luke has included for this formula.

STEP 5. CREATE THE METRICS FOR THE 5 LEVELS OR BANDS

We will identify the 5 levels with the following colors:

  1. Dark Red Color – #B84545
  2. Light Red Color – #E8C1C1
  3. White color – #E8C1C1
  4. Light Blue Color – #E8C1C1
  5. Dark Blue Color – #598DE7
Metric1IIF([NHN] < 0.2, [NHN] – 0.2, NULL)
Metric2IIF([NHN] < 0.4, MAX([NHN] – 0.4, -0.2), NULL)
Metric3The 40%-60% band is shown in white, so it is not necessary to define a formula for this range.
Metric4IIF([NHN] >= 0.6, MIN([NHN] – 0.6, 0.2), NULL)
Metric5IIF([NHN] >= 0.8, [NHN] – 0.8, NULL)

It is important to observe in the formulas of the light blue and light red metrics, the range of NHN values that consider, for example, the light red color metric, is assigned a value when the NHN is between 0 and 0.4; and not only the values from 0.2 to 0.4

STEP 6. CREATE THE CHART.

An Area type chart will be defined.

It should be indicated that the marks will not be stacked (Analysis – Stacks Marks – Off).

Move the “Axis Date” field to the column shelf and select with the right click that the exact date will be used.

Move the “Decade” field to the row shelf.

Move “Measure Name” to the filter shelf and to the color shelf (Filter the metrics to plot).

Move “Measure Values” to the row shelf.

Adjust the colors for each metric.

Reorder the metrics so that “Metric5” is listed before “Metric4”, so that “Metric4” does not hide “Metric5”.

Move a second copy of “Measure Values” to the row shelf.

Indicate that it will work with a double axis. And adjust the axis in each of the copies of “Measure Value”, so that one uses a fixed range from 0 to 0.2 and the other uses a range from 0 to -0.2.

Ready!

Link here

I would like to share some of what I realized at the end of the exercise, as I found it interesting that there was a similarity between the work done on both axes of the chart.

  • On the one hand, for the “x” axis, it was necessary to work with the original dates of different decades to present them as if they were dates of a single decade.
  • On the other hand, for the “y” axis, it was required to work the normalized NH scale with values ranging from 0 to 1, to present them on a scale with values between 0 to ± 0.2.

Thank you very much and if you have any questions about the post, do not hesitate to contact me on Twitter (@rosariogaunag).