Class Kata "Box Plot

Create a graphical control with which Box plots can be displayed.

A box plot is displayed for a series of numbers. To get a quick overview of a series of numbers, the following values of the number series are visualized in a box plot:

  • Minimum
  • Lower quartile
  • Median
  • Upper quartile
  • Maximum

The Minimum of a number series is the smallest value. Accordingly, the Maximum the largest value.

The Median is determined by using the middle value of the sorted value list. If the list contains an even number of values, the two middle values are used and the mean value is calculated from them.

Around the lower and upper Quartile of the values, the series of numbers must also be sorted. The list is then divided into two equal parts. The middle value from the bottom half is used as the lower quartile, while the middle value from the top half forms the upper quartile. Again, if the number of values is even, the two middle values are used to form the mean value.

The following figure shows an example of how the values are determined.

Class Kata Box Plot I - Clean Code Developer Akademie

The following box plot is to be generated as a result for the example values:

Class Kata Box Plot II - Clean Code Developer Akademie


The control should also have a property Orientation which is used to set whether the box plot is displayed horizontally or vertically.