Skip to content
Bump

Bump

A bump chart.

Bump

Usage

from dataviz_mojo import bump
from dataviz_mojo.plot import save
from dataviz_mojo.theme import Theme

def main() raises:
    var years: List[String] = ["2021", "2022", "2023", "2024"]
    var languages: List[String] = ["Python", "JavaScript", "Rust"]
    var scores: List[List[Float64]] = [
        [85.0, 90.0, 95.0, 98.0],
        [92.0, 88.0, 84.0, 80.0],
        [40.0, 55.0, 70.0, 85.0],
    ]

    var c = bump(years, languages, scores)
    save(c, "docs/src/examples/out_bump.svg")

Args:

  • categories: One position along the x-axis per entry, in the given order.
  • series_names: One line per name, used as the legend key.
  • values: values[j] is series_names[j]’s raw value per category – ranked into 1 = highest before drawing, not plotted directly.
  • 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.