5.1 KB185 lines
Blame
1<!doctype html>
2<html lang="en">
3 <head>
4 <meta charset="utf-8" />
5 <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6 <title>Mermaid Quick Test Page</title>
7 <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
8 <style>
9 div.mermaid {
10 /* font-family: 'trebuchet ms', verdana, arial; */
11 font-family: 'Courier New', Courier, monospace !important;
12 }
13 </style>
14 </head>
15
16 <body>
17 <h1>XY Charts demos</h1>
18 <pre class="mermaid">
19 xychart
20 title "Sales Revenue (in $)"
21 x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
22 y-axis "Revenue (in $)" 4000 --> 11000
23 bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
24 line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
25 </pre>
26 <hr />
27 <h1>XY Charts horizontal</h1>
28 <pre class="mermaid">
29 xychart horizontal
30 title "Basic xychart"
31 x-axis "this is x axis" [category1, "category 2", category3, category4]
32 y-axis yaxisText 10 --> 150
33 bar "sample bat" [52, 96, 35, 10]
34 line [23, 46, 75, 43]
35 </pre>
36 <hr />
37 <h1>XY Charts only lines and bar</h1>
38 <pre class="mermaid">
39 xychart
40 line [23, 46, 77, 34]
41 line [45, 32, 33, 12]
42 line [87, 54, 99, 85]
43 line [78, 88, 22, 4]
44 line [22, 29, 75, 33]
45 bar [52, 96, 35, 10]
46 </pre>
47
48 <hr />
49 <h1>XY Charts with +ve and -ve numbers</h1>
50 <pre class="mermaid">
51 xychart
52 line [+1.3, .6, 2.4, -.34]
53 </pre>
54
55 <h1>XY Charts Bar with multiple category</h1>
56 <pre class="mermaid">
57 xychart
58 title "Basic xychart with many categories"
59 x-axis "this is x axis" [category1, "category 2", category3, category4, category5, category6, category7]
60 y-axis yaxisText 10 --> 150
61 bar "sample bar" [52, 96, 35, 10, 87, 34, 67, 99]
62 </pre>
63
64 <h1>XY Charts line with multiple category</h1>
65 <pre class="mermaid">
66 xychart
67 title "Line chart with many category"
68 x-axis "this is x axis" [category1, "category 2", category3, category4, category5, category6, category7]
69 y-axis yaxisText 10 --> 150
70 line "sample line" [52, 96, 35, 10, 87, 34, 67, 99]
71 </pre>
72
73 <h1>XY Charts category with large text</h1>
74 <pre class="mermaid">
75 xychart
76 title "Basic xychart with many categories with category overlap"
77 x-axis "this is x axis" [category1, "Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.", category3, category4, category5, category6, category7]
78 y-axis yaxisText 10 --> 150
79 bar "sample bar" [52, 96, 35, 10, 87, 34, 67, 99]
80 </pre>
81
82 <h1>sparkline demo</h1>
83 <pre class="mermaid">
84---
85config:
86 theme: dark
87 xyChart:
88 width: 200
89 height: 20
90 plotReservedSpacePercent: 100
91---
92 xychart
93 line [5000, 9000, 7500, 6200, 9500, 5500, 11000, 8200, 9200, 9500, 7000, 8800]
94 </pre>
95
96 <h1>sparkBar demo</h1>
97 <pre class="mermaid">
98---
99config:
100 theme: dark
101 xyChart:
102 width: 200
103 height: 20
104 plotReservedSpacePercent: 100
105---
106 xychart
107 bar [5000, 9000, 7500, 6200, 9500, 5500, 11000, 8200, 9200, 9500, 7000, 8800]
108 </pre>
109
110 <h1>XY Charts demos with all configs</h1>
111 <pre class="mermaid">
112---
113config:
114 theme: forest
115 xyChart:
116 width: 1000
117 height: 600
118 titlePadding: 5
119 titleFontSize: 10
120 xAxis:
121 labelFontSize: 20
122 labelPadding: 10
123 titleFontSize: 30
124 titlePadding: 20
125 tickLength: 10
126 tickWidth: 5
127 axisLineWidth: 5
128 yAxis:
129 labelFontSize: 20
130 labelPadding: 10
131 titleFontSize: 30
132 titlePadding: 20
133 tickLength: 10
134 tickWidth: 5
135 axisLineWidth: 5
136 chartOrientation: horizontal
137 plotReservedSpacePercent: 60
138---
139 xychart
140 title "Sales Revenue"
141 x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
142 y-axis "Revenue (in $)" 4000 --> 11000
143 bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
144 line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
145
146 </pre>
147 <h1>XY Charts demos with all theme config</h1>
148 <pre class="mermaid">
149---
150config:
151 themeVariables:
152 xyChart:
153 titleColor: "#ff0000"
154 backgroundColor: "#f0f8ff"
155 yAxisLabelColor: "#ee82ee"
156 yAxisTitleColor: "#7fffd4"
157 yAxisTickColor: "#87ceeb"
158 yAxisLineColor: "#ff6347"
159 xAxisLabelColor: "#7fffd4"
160 xAxisTitleColor: "#ee82ee"
161 xAxisTickColor: "#ff6347"
162 xAxisLineColor: "#87ceeb"
163 plotColorPalette: "#008000, #faba63"
164---
165 xychart
166 title "Sales Revenue"
167 x-axis Months [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
168 y-axis "Revenue (in $)" 4000 --> 11000
169 bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
170 line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
171
172 </pre>
173 <hr />
174
175 <script type="module">
176 import mermaid from './mermaid.esm.mjs';
177 mermaid.initialize({
178 theme: 'default',
179 logLevel: 3,
180 securityLevel: 'loose',
181 });
182 </script>
183 </body>
184</html>
185