markdown图表

本文详细介绍了流程图、时序图、状态图、类图和甘特图这五种图表的用途和创建方法,并提供了具体的代码示例。流程图用于展示流程步骤,时序图用于表示对象间的交互,状态图用于描述对象状态变化,类图用于表示类与类之间的关系,甘特图则用于项目进度管理。这些图表在软件开发和系统设计中起到关键作用,帮助理解复杂系统的工作原理和流程。
摘要由CSDN通过智能技术生成

流程图

graph 关键字就是声明一张流程图,TD 表示的是方向,这里的含义是 Top-Down 由上至下。

graph TD;
    client-->VIP1_keepalived;
    client-->VIP2_keepalived;
    VIP1_keepalived-->数据库mysql_1;
    VIP1_keepalived-->数据库mysql_2;
    VIP1_keepalived-->数据库mysql_3;
    VIP2_keepalived-->数据库mysql_1;
    VIP2_keepalived-->数据库mysql_2;
    VIP2_keepalived-->数据库mysql_3;
client
VIP1_keepalived
VIP2_keepalived
数据库mysql_1
数据库mysql_2
数据库mysql_3

时序图

语法解释:->> 代表实线箭头,-->> 则代表虚线。

sequenceDiagram	
 master->>slave: grant 权限 XXX
 slave-->>master: change master to XXX
master slave grant 权限 XXX change master to XXX master slave

状态图

[*] 表示开始或者结束,如果在箭头右边则表示结束。

stateDiagram
  [*] --> 修改
    修改 --> [*] 
修改

类图

语法解释:<|-- 表示继承,+ 表示 public- 表示 private,学过 Java 的应该都知道。

classDiagram
      Animal <|-- Duck
      Animal <|-- Fish
      Animal <|-- Zebra
      Animal : +int age
      Animal : +String gender
      Animal: +isMammal()
      Animal: +mate()
      class Duck{
          +String beakColor
          +swim()
          +quack()
      }
      class Fish{
          -int sizeInFeet
          -canEat()
      }
      class Zebra{
          +bool is_wild
          +run()
      }
Animal
+int age
+String gender
+isMammal()
+mate()
Duck
+String beakColor
+swim()
+quack()
Fish
-int sizeInFeet
-canEat()
Zebra
+bool is_wild
+run()

甘特图

从上到下依次是图片标题、日期格式、项目、项目细分的任务。

gantt
    title 工作计划
    dateFormat  YYYY-MM-DD
    section Section
    A task           :a1, 2020-01-01, 30d
    Another task     :after a1  , 20d
    section Another
    Task in sec      :2020-01-12  , 12d
    another task      : 24d
Mon 06 Mon 13 Mon 20 Mon 27 Mon 03 Mon 10 Mon 17 A task Another task Task in sec another task Section Another 工作计划

饼图

饼图使用 pie 表示,标题下面分别是区域名称及其百分比。

pie
    title Key elements in Product X
    "win7" : 1
    "win8" : 1
    "win9" : 1
    "win10" :  1
25% 25% 25% 25% Key elements in Product X win7 win8 win9 win10

导出

Product X
“win7” : 1
“win8” : 1
“win9” : 1
“win10” : 1


### **导出**

绘制好的图片可以选择菜单/文件/导出,导出为图片或者网页格式。在网页中图片是以 SVG 格式渲染的,你可以复制 SVG 内容,导入到 SVG 的图片编辑器中进一步操作。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值