<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mizumm</title>
    <description>The latest articles on DEV Community by mizumm (@mizumm).</description>
    <link>https://dev.to/mizumm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F141597%2F4a83a768-db99-48ff-87ac-805ed8aff719.png</url>
      <title>DEV Community: mizumm</title>
      <link>https://dev.to/mizumm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mizumm"/>
    <language>en</language>
    <item>
      <title>How to make Gantt chart by mermaid</title>
      <dc:creator>mizumm</dc:creator>
      <pubDate>Sat, 02 Mar 2019 21:17:19 +0000</pubDate>
      <link>https://dev.to/mizumm/-how-to-make-gantt-chart-by-mermaid-2meo</link>
      <guid>https://dev.to/mizumm/-how-to-make-gantt-chart-by-mermaid-2meo</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Mermaid is a simple markdown-like script language for generating charts from the text.&lt;br&gt;
This document shows the way to create the following Gantt chart by using mermaid cli tool.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffgtmdjxioha18llu2162.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffgtmdjxioha18llu2162.png" alt="Sample Gant Chart" width="784" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mermaid Github repo:&lt;br&gt;
&lt;a href="https://github.com/knsv/mermaid" rel="noopener noreferrer"&gt;https://github.com/knsv/mermaid&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Environment
&lt;/h1&gt;

&lt;p&gt;Ubuntu 18.04 LTS (x86_64)&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Install npm command&lt;/p&gt;

&lt;p&gt;There are some ways to install npm. Google it :-)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install mermaid.cli via npm&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;      &lt;span class="nv"&gt;$ &lt;/span&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;mermaid.cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  How to create a Gantt chart
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Create a  mermaid file, for example, test.mmd:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    gantt
         title A Gantt Diagram
         dateFormat YYYY-MM-DD
         section Section
         A task :a1, 2019-01-01, 30d
         Another task :after a1 , 20d
         section Another
         Task in sec :2019-01-12 , 12d
         another task : 24d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The syntax is here:&lt;br&gt;
&lt;a href="https://mermaidjs.github.io/gantt.html" rel="noopener noreferrer"&gt;https://mermaidjs.github.io/gantt.html&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Run mmdc command.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;~/node_modules/.bin/mmdc &lt;span class="nt"&gt;-i&lt;/span&gt; test.mmd &lt;span class="nt"&gt;-o&lt;/span&gt; test.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see the PNG file as test.png.&lt;/p&gt;

&lt;h1&gt;
  
  
  Tips
&lt;/h1&gt;

&lt;h2&gt;
  
  
  To remove today's red line
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create the following json file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"themeCSS"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;".today {fill: none; stroke: red; stroke-width: 0px;}"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt; Pass the json file as following.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  $ ~/node_modules/.bin/mmdc -c config.json -i test.mmd -o test.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
