跳至内容

XYChart 配置模式

txt
https://mermaid.npmjs.net.cn/schemas/config.schema.json#/$defs/XYChartConfig

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

抽象可扩展状态可识别自定义属性附加属性访问限制定义于
可以实例化未知状态禁止允许config.schema.json*

XYChartConfig 类型

object (XYChart 配置)

all of

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

此对象包含 XYChart 轴配置

xAxis

xAxis 类型

object (XYChart 轴配置)

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

此对象包含 XYChart 轴配置

yAxis

yAxis 类型

object (XYChart 轴配置)

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