組み込みProgrammerのチラシの裏

Yasnippet > Plantuml > ガントチャート

| Comments

ガントチャートスニペット

yasnippet/helm

yasnippetやhelmの概要、インストール方法、およびスニペット登録方法は以下を参照 yasnippet/helm

スニペット

以下のスニペットを登録する

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- mode: snippet -*-
# name: plantuml-gantt
# key: plantuml-gantt
# --
#+begin_src plantuml :file (concat (file-name-nondirectory buffer-file-name) ".gantt.png")
@startgantt
language ja
saturday are colored in LightGray
sunday   are colored in LightGray
' saturday are closed
' sunday   are closed

' Gantt aliases work differently from other diagrams (it is not possible to give the same "label" to a task)
' https://forum.plantuml.net/12176/gantt-aliases-differently-other-diagrams-possible-same-label
!define N(x,n) x<size:0>n</size>
Project starts 2024-01-22
[N(T,1)] starts 2024-01-22 and requires 5 day
[N(T,2)] starts 2024-01-22 and requires 5 day
[N(T,3)] happens 2024-01-22

[T1] starts 2024-01-22 and requires 5 day
[T2] starts 2024-01-22 and requires 5 day
[T3] happens 2024-01-22
@endgantt
#+end_src

使用方法

plantuml-ganttを挿入すると以下になる。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#+begin_src plantuml :file (concat (file-name-nondirectory buffer-file-name) ".gantt.png")
  @startgantt
  language ja
  saturday are colored in LightGray
  sunday   are colored in LightGray
  ' saturday are closed
  ' sunday   are closed

  ' Gantt aliases work differently from other diagrams (it is not possible to give the same "label" to a task)
  ' https://forum.plantuml.net/12176/gantt-aliases-differently-other-diagrams-possible-same-label
  !define N(x,n) x<size:0>n</size>
  Project starts 2024-01-22
  [N(T,1)] starts 2024-01-22 and requires 5 day
  [N(T,2)] starts 2024-01-22 and requires 5 day
  [N(T,3)] happens 2024-01-22

  [T1] starts 2024-01-22 and requires 5 day
  [T2] starts 2024-01-22 and requires 5 day
  [T3] happens 2024-01-22
  @endgantt
#+end_src

begin_srcからend_srcの中でC-c C-cすると以下の画像を生成する。

長さ

Comments