Gantt Chart

SVG Gantt chart for project management timelines.

python 8 params

Preview

Sprint plan123456789DesignDesign: Day 0-3BuildBuild: Day 2-7ShipShip: Day 6-8
Arguments
gantt_chart(title='Sprint plan', tasks=[{'name': 'Design', 'start': 0, 'duration': 3}, {'name': 'Build', 'start': 2, 'duration': 5}, {'name': 'Ship', 'start': 6, 'duration': 2}])

Usage

views.py
python
from djust import LiveView
from djust.components import GanttChart


class MyView(LiveView):
    template_name = "my_template.html"

    def mount(self, request, **kwargs):
        self.component = GanttChart(title='Sprint plan', tasks=[{'name': 'Design', 'start': 0, 'duration': 3}, {'name': 'Build', 'start': 2, 'duration': 5}, {'name': 'Ship', 'start': 6, 'duration': 2}])
my_template.html
django
{{ component }}

Parameters

NameTypeDefault
taskslist | NoneNone
titlestr | NoneNone
unit_labelstr'Day'
unitsint | NoneNone
row_heightint32
widthint600
custom_classstr''
**kwargs— passed to `Component.__init__`: `name=` identifies the instance in the events it sends, `id=` sets `component.id`, and any other keyword is kept as state
Source & styles
FilePathNotes
moduledjust.components.components.gantt_chartSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 6 of this component's classes at line 2168, 2433, 2434, 2435, 2436, 2437. Override those rules, or the custom properties they read, in a stylesheet loaded after it.