Skip to content
Gantt

Gantt

A gantt/span chart.

Gantt

Usage

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

def main() raises:
    var tasks: List[String] = ["Design", "Development", "Testing", "Documentation", "Launch"]
    var start: List[Float64] = [0.0, 5.0, 20.0, 15.0, 28.0]
    var end: List[Float64] = [8.0, 25.0, 28.0, 27.0, 30.0]

    var c = gantt(tasks, start, end)
    save(c, "docs/src/examples/out_gantt.svg")

Args:

  • categories: One horizontal bar per entry, top to bottom.
  • start: Each bar’s starting value.
  • end: Each bar’s ending value.
  • 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.