# Chart example ## sequence ```sequence Title: This is a title participant China as C participant Andrew as A A->C: Says Hello Note left of A: Note left \nof Andrew Note right of C: China thinks\nabout it C-->A: How are you? A->>C: I am good thanks! Note right of A: Note right \nof Andrew Note over A: Note over Andrew1 Note over A: Note over Andrew2 Note over A,C: Note over both Andrew and China ``` ### references 1. [js-sequence-diagrams](https://bramp.github.io/js-sequence-diagrams/) --- ## mermaid - Sequence diagram ```mermaid sequenceDiagram Alice->>John: Hello John, how are you? loop Healthcheck John->>John: Fight against hypochondria end Note right of John: Rational thoughts! John-->>Alice: Great! John->>Bob: How about you? Bob-->>John: Jolly good! ``` ## mermaid - Flowchart ```mermaid graph TD; A-->B; A-->C; B-->D; C-->D; ``` ## mermaid - Class diagrams ```mermaid 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() } ``` ## mermaid - Gantt diagram ```mermaid gantt dateFormat YYYY-MM-DD title Adding GANTT diagram to mermaid excludes weekdays 2014-01-10 section A section Completed task:done, des1, 2014-01-06,2014-01-08 Active task:active, des2, 2014-01-09, 3d Future task: des3, after des2, 5d Future task2: des4, after des3, 5d ``` ## mermaid - Git graph ```mermaid gitGraph: options { "nodeSpacing": 70, "nodeRadius": 10 } end commit branch newbranch checkout newbranch commit commit checkout master commit commit merge newbranch ``` ## mermaid - Pie chart ```mermaid pie title Pets adopted by volunteers "Dogs" : 386 "Cats" : 85 "Rats" : 15 ``` ### references 1. [mermaid](https://mermaid-js.github.io/mermaid/#/README) ###### tags: `example` `HackMD功能介紹`