返回介绍

6.8 Gant 图

发布于 2023-07-20 21:09:29 字数 2947 浏览 0 评论 0 收藏 0

Gant 图用于说明工程进度,它通过指定元素的起止时间来说明工程进度信息。

可以通过 gantt 命令创建时序图,如:

	~~~mermaid
	gantt
		title A Gantt Diagram

	section Section
	A task           :a1, 2014-01-01, 30d
	Another task     :after a1  , 20d
	section Another
	Task in sec      :2014-01-12  , 12d
	anther task      : 24d
	~~~

的图形为:

~~~mermaid
gantt
title A Gantt Diagram
section Section
A task :a1, 2014-01-01, 30d
Another task :after a1 , 20d
section Another
Task in sec :2014-01-12 , 12d
anther task : 24d
~~~

6.8.1 语法

其语法参考下面的示例:

	~~~mermaid
		gantt
		dateFormat  YYYY-MM-DD
		title Adding GANTT diagram functionality to mermaid

		section A section
		Completed task            :done,    des1, 2014-01-06,2014-01-08
		Active task               :active,  des2, 2014-01-09, 3d
		Future task               :         des3, after des2, 5d
		Future task2               :         des4, after des3, 5d

		section Critical tasks
		Completed task in the critical line :crit, done, 2014-01-06,24h
		Implement parser and jison          :crit, done, after des1, 2d
		Create tests for parser             :crit, active, 3d
		Future task in critical line        :crit, 5d
		Create tests for renderer           :2d
		Add to mermaid                      :1d

		section Documentation
		Describe gantt syntax               :active, a1, after des1, 3d
		Add gantt diagram to demo page      :after a1  , 20h
		Add another diagram to demo page    :doc1, after a1  , 48h

		section Last section
		Describe gantt syntax               :after doc1, 3d
		Add gantt diagram to demo page      : 20h
		Add another diagram to demo page    : 48h
	~~~

的图形为:

~~~mermaid
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to mermaid :1d
section Documentation
Describe gantt syntax :active, a1, after des1, 3d
Add gantt diagram to demo page :after a1 , 20h
Add another diagram to demo page :doc1, after a1 , 48h
section Last section
Describe gantt syntax :after doc1, 3d
Add gantt diagram to demo page : 20h
Add another diagram to demo page : 48h
~~~

  • title 为标题元素
  • section 为段元素
    • section 中每条 task 的组成为 task description:任务属性,任务 name,任务位置,任务开始时间, 任务结束时间

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文