Automatic Legends for Proportional Symbol Maps


This SVG application demonstrates self-adjusting legends for proportional symbol maps. Legends only display intermediate symbols for round values (for example 100, 250, 500, 1000, 2500, etc.). The legend will always display a set of appropriate intermediate symbols, even when the minimum and the maximum values are very large or very small. This algorithm is used for legends for proportional symbol maps in the Atlas of Switzerland 3.

Paper with more details and corrigendum
Jenny, B., Hutzler, E. and Hurni, L. (2009)
Self-adjusting legends for proportional symbol maps.
Cartographica, 44-4, p. 301–304.
Maximum:
Minimum:
Size:
Font Size:
Distance:
Breaks:

Parameters

  • The Maximum and the Minimum value define the range of the legend. Fractional positive numbers can be entered.
  • The Size slider adjusts the legend size.
  • Font Size controls the size of the text labels.
  • The Distance slider defines the minimum distance between two symbols. The minimum distance is the value selected with this slider, multiplied by the type size. If two intermediate symbols are closer than this distance, the smaller symbol is removed. The default value is 1.25, which does not need to be be changed in most cases.
  • Intermediate symbols will be inserted at multiples of values entered in the Breaks field. Example: A break value of 5 will place symbols at 0.5, 5, 50, 500, etc. The symbols actually displayed also depend on the value specified by the Distance slider. The default break values are 5 2.5 1. These values do not need to be changed in most cases.

Code

SVG / JavaScript sample page (by Mostafa El-Fouly and Bernie Jenny)
Core algorithm in Java

License: The code linked above can be used for any application, including commercial use, without asking permission from the authors.