跳到內容

XY圖表配置綱要

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

此物件包含 XY 圖表特定的設定

抽象可擴展狀態可識別自訂屬性額外屬性存取限制定義於
可以實例化未知狀態禁止允許config.schema.json*

XYChartConfig 類型

object (XY圖表配置)

全部

XYChartConfig 屬性

屬性類型必填可為空定義者
widthnumber必填不可為空Mermaid 配置
heightnumber必填不可為空Mermaid 配置
titleFontSizenumber必填不可為空Mermaid 配置
titlePaddingnumber必填不可為空Mermaid 配置
showTitleboolean必填不可為空Mermaid 配置
xAxisobject必填不可為空Mermaid 配置
yAxisobject必填不可為空Mermaid 配置
chartOrientation未指定必填不可為空Mermaid 配置
plotReservedSpacePercentnumber必填不可為空Mermaid 配置

width

圖表的寬度

width

width 類型

number

width 約束

最小值: 此數字的值必須大於或等於: 1

width 預設值

預設值為

json
700

height

圖表的高度

height

height 類型

number

height 約束

最小值: 此數字的值必須大於或等於: 1

height 預設值

預設值為

json
500

titleFontSize

圖表標題的字體大小

titleFontSize

titleFontSize 類型

number

titleFontSize 約束

最小值: 此數字的值必須大於或等於: 1

titleFontSize 預設值

預設值為

json
20

titlePadding

圖表標題的頂部和底部空間

titlePadding

titlePadding 類型

number

titlePadding 約束

最小值: 此數字的值必須大於或等於: 0

titlePadding 預設值

預設值為

json
10

showTitle

是否顯示圖表標題

showTitle

showTitle 類型

boolean

showTitle 預設值

預設值為

json
true

xAxis

此物件包含 XY 圖表軸配置的設定

xAxis

xAxis 類型

object (XY圖表軸配置)

xAxis 預設值

預設值為

json
{
  "$ref": "#/$defs/XYChartAxisConfig",
  "title": "XYChart axis config",
  "description": "This object contains configuration for XYChart axis config",
  "type": "object",
  "unevaluatedProperties": true,
  "required": [
    "showLabel",
    "labelFontSize",
    "labelPadding",
    "showTitle",
    "titleFontSize",
    "titlePadding",
    "showTick",
    "tickLength",
    "tickWidth",
    "showAxisLine",
    "axisLineWidth"
  ],
  "properties": {
    "showLabel": {
      "description": "Should show the axis labels (tick text)",
      "type": "boolean",
      "default": true
    },
    "labelFontSize": {
      "description": "font size of the axis labels (tick text)",
      "type": "number",
      "default": 14,
      "minimum": 1
    },
    "labelPadding": {
      "description": "top and bottom space from axis label (tick text)",
      "type": "number",
      "default": 5,
      "minimum": 0
    },
    "showTitle": {
      "description": "Should show the axis title",
      "type": "boolean",
      "default": true
    },
    "titleFontSize": {
      "description": "font size of the axis title",
      "type": "number",
      "default": 16,
      "minimum": 1
    },
    "titlePadding": {
      "description": "top and bottom space from axis title",
      "type": "number",
      "default": 5,
      "minimum": 0
    },
    "showTick": {
      "description": "Should show the axis tick lines",
      "type": "boolean",
      "default": true
    },
    "tickLength": {
      "description": "length of the axis tick lines",
      "type": "number",
      "default": 5,
      "minimum": 1
    },
    "tickWidth": {
      "description": "width of the axis tick lines",
      "type": "number",
      "default": 2,
      "minimum": 1
    },
    "showAxisLine": {
      "description": "Show line across the axis",
      "type": "boolean",
      "default": true
    },
    "axisLineWidth": {
      "description": "Width of the axis line",
      "type": "number",
      "default": 2,
      "minimum": 1
    }
  }
}

yAxis

此物件包含 XY 圖表軸配置的設定

yAxis

yAxis 類型

object (XY圖表軸配置)

yAxis 預設值

預設值為

json
{
  "$ref": "#/$defs/XYChartAxisConfig",
  "title": "XYChart axis config",
  "description": "This object contains configuration for XYChart axis config",
  "type": "object",
  "unevaluatedProperties": true,
  "required": [
    "showLabel",
    "labelFontSize",
    "labelPadding",
    "showTitle",
    "titleFontSize",
    "titlePadding",
    "showTick",
    "tickLength",
    "tickWidth",
    "showAxisLine",
    "axisLineWidth"
  ],
  "properties": {
    "showLabel": {
      "description": "Should show the axis labels (tick text)",
      "type": "boolean",
      "default": true
    },
    "labelFontSize": {
      "description": "font size of the axis labels (tick text)",
      "type": "number",
      "default": 14,
      "minimum": 1
    },
    "labelPadding": {
      "description": "top and bottom space from axis label (tick text)",
      "type": "number",
      "default": 5,
      "minimum": 0
    },
    "showTitle": {
      "description": "Should show the axis title",
      "type": "boolean",
      "default": true
    },
    "titleFontSize": {
      "description": "font size of the axis title",
      "type": "number",
      "default": 16,
      "minimum": 1
    },
    "titlePadding": {
      "description": "top and bottom space from axis title",
      "type": "number",
      "default": 5,
      "minimum": 0
    },
    "showTick": {
      "description": "Should show the axis tick lines",
      "type": "boolean",
      "default": true
    },
    "tickLength": {
      "description": "length of the axis tick lines",
      "type": "number",
      "default": 5,
      "minimum": 1
    },
    "tickWidth": {
      "description": "width of the axis tick lines",
      "type": "number",
      "default": 2,
      "minimum": 1
    },
    "showAxisLine": {
      "description": "Show line across the axis",
      "type": "boolean",
      "default": true
    },
    "axisLineWidth": {
      "description": "Width of the axis line",
      "type": "number",
      "default": 2,
      "minimum": 1
    }
  }
}

chartOrientation

繪製圖表的方式,水平或垂直

chartOrientation

  • 為必填

  • 類型: 未知

  • 不可為空

  • 定義於: Mermaid 配置

  • tsType: "vertical" | "horizontal"

chartOrientation 類型

未知

chartOrientation 預設值

預設值為

json
"vertical"

plotReservedSpacePercent

圖表繪圖所佔空間的最小百分比

plotReservedSpacePercent

plotReservedSpacePercent 類型

number

plotReservedSpacePercent 約束

最小值: 此數字的值必須大於或等於: 30

plotReservedSpacePercent 預設值

預設值為

json
50