Skip to content

Gantt Diagram Config Schema ​

txt
https://mermaid.js.org/schemas/config.schema.json#/$defs/GanttDiagramConfig

包含特定于甘特图的配置的对象

AbstractExtensibleStatusIdentifiableCustom PropertiesAdditional PropertiesAccess RestrictionsDefined In
Can be instantiatedNoUnknown statusNoForbiddenAllowednoneconfig.schema.json*

GanttDiagramConfig Type ​

object (Gantt Diagram Config)

all of

GanttDiagramConfig Properties ​

PropertyTypeRequiredNullableDefined by
titleTopMarginintegerRequiredcannot be nullMermaid Config
barHeightintegerRequiredcannot be nullMermaid Config
barGapintegerOptionalcannot be nullMermaid Config
topPaddingintegerRequiredcannot be nullMermaid Config
rightPaddingintegerRequiredcannot be nullMermaid Config
leftPaddingintegerRequiredcannot be nullMermaid Config
gridLineStartPaddingintegerRequiredcannot be nullMermaid Config
fontSizeintegerRequiredcannot be nullMermaid Config
sectionFontSizeintegerRequiredcannot be nullMermaid Config
numberSectionStylesintegerRequiredcannot be nullMermaid Config
axisFormatstringRequiredcannot be nullMermaid Config
tickIntervalstringOptionalcannot be nullMermaid Config
topAxisbooleanRequiredcannot be nullMermaid Config
displayModestringOptionalcannot be nullMermaid Config
weekdaystringRequiredcannot be nullMermaid Config

titleTopMargin ​

图表上方文本的顶部边​​距

titleTopMargin

titleTopMargin Type ​

integer

titleTopMargin Constraints ​

minimum: the value of this number must greater than or equal to: 0

titleTopMargin Default Value ​

The default value is:

json
25

barHeight ​

图形中条形的高度

barHeight

barHeight Type ​

integer

barHeight Constraints ​

minimum: the value of this number must greater than or equal to: 0

barHeight Default Value ​

The default value is:

json
20

barGap ​

甘特图中不同活动之间的边距

barGap

barGap Type ​

integer

barGap Constraints ​

minimum: the value of this number must greater than or equal to: 0

barGap Default Value ​

The default value is:

json
4

topPadding ​

标题和甘特图之间以及轴和甘特图之间的边距。

topPadding

topPadding Type ​

integer

topPadding Constraints ​

minimum: the value of this number must greater than or equal to: 0

topPadding Default Value ​

The default value is:

json
50

rightPadding ​

分配给活动右侧部分名称的空间

rightPadding

rightPadding Type ​

integer

rightPadding Constraints ​

minimum: the value of this number must greater than or equal to: 0

rightPadding Default Value ​

The default value is:

json
75

leftPadding ​

分配给活动左侧部分名称的空间

leftPadding

leftPadding Type ​

integer

leftPadding Constraints ​

minimum: the value of this number must greater than or equal to: 0

leftPadding Default Value ​

The default value is:

json
75

gridLineStartPadding ​

网格线的垂直起始位置

gridLineStartPadding

gridLineStartPadding Type ​

integer

gridLineStartPadding Constraints ​

minimum: the value of this number must greater than or equal to: 0

gridLineStartPadding Default Value ​

The default value is:

json
35

fontSize ​

字体大小

fontSize

fontSize Type ​

integer

fontSize Constraints ​

minimum: the value of this number must greater than or equal to: 0

fontSize Default Value ​

The default value is:

json
11

sectionFontSize ​

各部分的字体大小

sectionFontSize

  • is required

  • Type: integer

  • cannot be null

  • defined in: Mermaid Config

  • tsType: string | number

sectionFontSize Type ​

integer

sectionFontSize Constraints ​

minimum: the value of this number must greater than or equal to: 0

sectionFontSize Default Value ​

The default value is:

json
11

numberSectionStyles ​

交替部分样式的数量

numberSectionStyles

numberSectionStyles Type ​

integer

numberSectionStyles Constraints ​

minimum: the value of this number must greater than or equal to: 0

numberSectionStyles Default Value ​

The default value is:

json
4

axisFormat ​

轴的日期/时间格式这可能需要调整以匹配你的语言环境和首选项。

axisFormat

axisFormat Type ​

string

axisFormat Default Value ​

The default value is:

json
"%Y-%m-%d"

tickInterval ​

轴刻度

Pattern is:

javascript
/^([1-9][0-9]*)(millisecond|second|minute|hour|day|week|month)$/;

tickInterval

tickInterval Type ​

string

tickInterval Constraints ​

pattern: the string must match the following regular expression:

javascript
/^([1-9][0-9]*)(millisecond|second|minute|hour|day|week|month)$/

try pattern

topAxis ​

设置此标志后,日期标签将添加到图表顶部

topAxis

topAxis Type ​

boolean

topAxis Default Value ​

The default value is:

json
false

displayMode ​

控制显示模式。

displayMode

displayMode Type ​

string

displayMode Constraints ​

enum: the value of this property must be equal to one of the following values:

ValueExplanation
""
"compact"Enables displaying multiple tasks on the same row.

displayMode Default Value ​

The default value is:

json
""

weekday ​

基于一周的间隔应在哪一天开始

weekday

weekday Type ​

string

weekday Constraints ​

enum: the value of this property must be equal to one of the following values:

ValueExplanation
"monday"
"tuesday"
"wednesday"
"thursday"
"friday"
"saturday"
"sunday"

weekday Default Value ​

The default value is:

json
"sunday"
Opens in mermaid.ai