{%hackmd rJ_1SdPkxx %} # Pie chart 1. Copy the syntax below and paste it in your note. 2. Using the syntax with three backticks (`) before "mermaid" and after the text, then the graph shows up. 3. Write down the title. 4. Write down the percentage for each item. ``` mermaid pie title What type of alcohol do you drink most often? "Beer" : 52.8 "Wine" : 24.8 "Whiskey" : 8.6 "Vodka" : 4.0 "Cock tail": 8.9 ``` :::info ### :pencil2: Notes - The sum of the numbers in a pie chart **must be 100**. - You may change the font size on the right - Add `%%{init: { "themeVariables": {"pieLegendTextSize": "10px"}} }%%` - `10px` represent the font size. ::: ### :eyes: Let's see how the syntax works in [both mode](https://hackmd.io/GfJohk2RQLu3QEFQ6oj89w/both) ## Followed by the presentation of the syntax ``` mermaid %%{init: { "themeVariables": {"pieLegendTextSize": "12px"}} }%% pie title What type of alcohol do you drink most often? "Beer" : 52.8 "Wine" : 24.8 "Whiskey" : 8.6 "Vodka" : 4.0 "Cock tail": 8.9 ``` ### :point_right: More syntax for mathematical expressions and charts can be explored [here](/s/MathJax-and-UML).