Skip to content
Polar Bar

Polar Bar

A circular column chart.

Polar Bar

Usage

from dataviz_mojo import polarbar
from dataviz_mojo.plot import save

def main() raises:
    var months: List[String] = [
        "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
    ]
    var rainfall: List[Float64] = [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]

    var c = polarbar(months, rainfall)
    save(c, "docs/src/examples/out_polarbar.svg")

Args:

  • categories: One equal-width angular slot per entry, in the given order.
  • values: Each bar’s length, proportional to value / max(values); every value must be non-negative, and at least one positive.
  • theme: Full styling knobs beyond this function’s own parameters (colors, margins, fonts, gridlines, …) – see Theme’s docstring.
  • width: Pixel width of the returned Plot (.size()).
  • height: Pixel height of the returned Plot (.size()).
  • title: The chart’s title, shown above the plot.
  • subtitle: A secondary line shown under the title.
  • x_title: The x-axis caption.
  • y_title: The y-axis caption.