Skip to content

XYChart Config Schema

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

此对象包含特定于 XYCharts 的配置

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

XYChartConfig Type

object (XYChart Config)

all of

XYChartConfig Properties

PropertyTypeRequiredNullableDefined by
widthnumberRequiredcannot be nullMermaid Config
heightnumberRequiredcannot be nullMermaid Config
titleFontSizenumberRequiredcannot be nullMermaid Config
titlePaddingnumberRequiredcannot be nullMermaid Config
showTitlebooleanRequiredcannot be nullMermaid Config
xAxisobjectRequiredcannot be nullMermaid Config
yAxisobjectRequiredcannot be nullMermaid Config
chartOrientationNot specifiedRequiredcannot be nullMermaid Config
plotReservedSpacePercentnumberRequiredcannot be nullMermaid Config

width

图表的宽度

width

width Type

number

width Constraints

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

width Default Value

The default value is:

json
700

height

图表的高度

height

height Type

number

height Constraints

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

height Default Value

The default value is:

json
500

titleFontSize

图表标题的字体大小

titleFontSize

titleFontSize Type

number

titleFontSize Constraints

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

titleFontSize Default Value

The default value is:

json
20

titlePadding

图表标题的顶部和底部空间

titlePadding

titlePadding Type

number

titlePadding Constraints

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

titlePadding Default Value

The default value is:

json
10

showTitle

应显示图表标题

showTitle

showTitle Type

boolean

showTitle Default Value

The default value is:

json
true

xAxis

此对象包含 XYChart 轴配置的配置

xAxis

xAxis Type

object (XYChart axis config)

xAxis Default Value

The default value is:

json
{
  "$ref": "#/$defs/XYChartAxisConfig",
  "title": "XYChart axis config",
  "description": "此对象包含 XYChart 轴配置的配置",
  "type": "object",
  "unevaluatedProperties": true,
  "required": [
    "showLabel",
    "labelFontSize",
    "labelPadding",
    "showTitle",
    "titleFontSize",
    "titlePadding",
    "showTick",
    "tickLength",
    "tickWidth",
    "showAxisLine",
    "axisLineWidth"
  ],
  "properties": {
    "showLabel": {
      "description": "应显示轴标签(刻度文本)",
      "type": "boolean",
      "default": true
    },
    "labelFontSize": {
      "description": "轴标签的字体大小(刻度文本)",
      "type": "number",
      "default": 14,
      "minimum": 1
    },
    "labelPadding": {
      "description": "轴标签(刻度文本)的顶部和底部空间",
      "type": "number",
      "default": 5,
      "minimum": 0
    },
    "showTitle": {
      "description": "应显示轴标题",
      "type": "boolean",
      "default": true
    },
    "titleFontSize": {
      "description": "轴标题的字体大小",
      "type": "number",
      "default": 16,
      "minimum": 1
    },
    "titlePadding": {
      "description": "轴标题的顶部和底部空间",
      "type": "number",
      "default": 5,
      "minimum": 0
    },
    "showTick": {
      "description": "应显示轴刻度线",
      "type": "boolean",
      "default": true
    },
    "tickLength": {
      "description": "轴刻度线的长度",
      "type": "number",
      "default": 5,
      "minimum": 1
    },
    "tickWidth": {
      "description": "轴刻度线的宽度",
      "type": "number",
      "default": 2,
      "minimum": 1
    },
    "showAxisLine": {
      "description": "显示跨轴线",
      "type": "boolean",
      "default": true
    },
    "axisLineWidth": {
      "description": "轴线的宽度",
      "type": "number",
      "default": 2,
      "minimum": 1
    }
  }
}

yAxis

此对象包含 XYChart 轴配置的配置

yAxis

yAxis Type

object (XYChart axis config)

yAxis Default Value

The default value is:

json
{
  "$ref": "#/$defs/XYChartAxisConfig",
  "title": "XYChart axis config",
  "description": "此对象包含 XYChart 轴配置的配置",
  "type": "object",
  "unevaluatedProperties": true,
  "required": [
    "showLabel",
    "labelFontSize",
    "labelPadding",
    "showTitle",
    "titleFontSize",
    "titlePadding",
    "showTick",
    "tickLength",
    "tickWidth",
    "showAxisLine",
    "axisLineWidth"
  ],
  "properties": {
    "showLabel": {
      "description": "应显示轴标签(刻度文本)",
      "type": "boolean",
      "default": true
    },
    "labelFontSize": {
      "description": "轴标签的字体大小(刻度文本)",
      "type": "number",
      "default": 14,
      "minimum": 1
    },
    "labelPadding": {
      "description": "轴标签(刻度文本)的顶部和底部空间",
      "type": "number",
      "default": 5,
      "minimum": 0
    },
    "showTitle": {
      "description": "应显示轴标题",
      "type": "boolean",
      "default": true
    },
    "titleFontSize": {
      "description": "轴标题的字体大小",
      "type": "number",
      "default": 16,
      "minimum": 1
    },
    "titlePadding": {
      "description": "轴标题的顶部和底部空间",
      "type": "number",
      "default": 5,
      "minimum": 0
    },
    "showTick": {
      "description": "应显示轴刻度线",
      "type": "boolean",
      "default": true
    },
    "tickLength": {
      "description": "轴刻度线的长度",
      "type": "number",
      "default": 5,
      "minimum": 1
    },
    "tickWidth": {
      "description": "轴刻度线的宽度",
      "type": "number",
      "default": 2,
      "minimum": 1
    },
    "showAxisLine": {
      "description": "显示跨轴线",
      "type": "boolean",
      "default": true
    },
    "axisLineWidth": {
      "description": "轴线的宽度",
      "type": "number",
      "default": 2,
      "minimum": 1
    }
  }
}

chartOrientation

如何绘制水平或垂直图形

chartOrientation

  • is required

  • Type: unknown

  • cannot be null

  • defined in: Mermaid Config

  • tsType: "vertical" | "horizontal"

chartOrientation Type

unknown

chartOrientation Default Value

The default value is:

json
"vertical"

plotReservedSpacePercent

图表占用的空间图的最小百分比

plotReservedSpacePercent

plotReservedSpacePercent Type

number

plotReservedSpacePercent Constraints

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

plotReservedSpacePercent Default Value

The default value is:

json
50