{% mermaid %} pie title Key elements in Product X "Calcium" : 42.96 "Potassium" : 50.05 "Magnesium" : 10.01 "Iron" : 5 {% endmermaid %}
1 2 3 4 5 6 7 8 9 10 11
Syntax #语法 Drawing a pie chart is really simple in mermaid. #饼图在mermaid中非常简单
Start with keyword to begin the diagrampie #以图表作为关键字开始 Followed by keyword and its value in string to give a title to the pie-chart. This is OPTIONALtitle #title后就是pie的标题 Followed by dataSet #其次是数据集 label for a section in the pie diagram within quotes." " #引号内的标签自定义代表饼图元素 Followed by colon as separator: #冒号后定义其元素的值 Followed by (supported upto two decimal places)positive numeric value #数值最多支持两位小数 [pie] [title] [titlevalue] (OPTIONAL) "[datakey1]" : [dataValue1] "[datakey2]" : [dataValue2] "[datakey3]" : [dataValue3] . .