flowbite-mcp 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +49 -74
  2. package/build/index.js +20 -36
  3. package/data/components/accordion.md +39 -53
  4. package/data/components/alerts.md +27 -44
  5. package/data/components/avatar.md +20 -33
  6. package/data/components/badge.md +34 -47
  7. package/data/components/banner.md +10 -29
  8. package/data/components/bottom-navigation.md +16 -29
  9. package/data/components/breadcrumb.md +12 -25
  10. package/data/components/button-group.md +26 -39
  11. package/data/components/buttons.md +41 -67
  12. package/data/components/card.md +34 -47
  13. package/data/components/carousel.md +25 -39
  14. package/data/components/chat-bubble.md +36 -50
  15. package/data/components/clipboard.md +256 -252
  16. package/data/components/datepicker.md +56 -70
  17. package/data/components/device-mockups.md +16 -29
  18. package/data/components/drawer.md +42 -56
  19. package/data/components/dropdowns.md +66 -80
  20. package/data/components/footer.md +16 -29
  21. package/data/components/forms.md +32 -50
  22. package/data/components/gallery.md +16 -33
  23. package/data/components/indicators.md +18 -31
  24. package/data/components/jumbotron.md +12 -25
  25. package/data/components/kbd.md +14 -27
  26. package/data/components/list-group.md +14 -27
  27. package/data/components/mega-menu.md +10 -24
  28. package/data/components/modal.md +37 -51
  29. package/data/components/navbar.md +41 -55
  30. package/data/components/pagination.md +22 -35
  31. package/data/components/popover.md +36 -51
  32. package/data/components/progress.md +10 -23
  33. package/data/components/qr-code.md +41 -133
  34. package/data/components/rating.md +16 -29
  35. package/data/components/sidebar.md +15 -30
  36. package/data/components/skeleton.md +16 -29
  37. package/data/components/speed-dial.md +40 -55
  38. package/data/components/spinner.md +14 -27
  39. package/data/components/stepper.md +14 -27
  40. package/data/components/tables.md +45 -64
  41. package/data/components/tabs.md +30 -45
  42. package/data/components/timeline.md +10 -23
  43. package/data/components/toast.md +25 -39
  44. package/data/components/tooltips.md +24 -39
  45. package/data/components/typography.md +22 -35
  46. package/data/components/video.md +14 -27
  47. package/data/forms/checkbox.md +27 -43
  48. package/data/forms/file-input.md +12 -26
  49. package/data/forms/floating-label.md +12 -25
  50. package/data/forms/input-field.md +17 -32
  51. package/data/forms/number-input.md +83 -93
  52. package/data/forms/phone-input.md +42 -54
  53. package/data/forms/radio.md +23 -39
  54. package/data/forms/range.md +12 -26
  55. package/data/forms/search-input.md +14 -31
  56. package/data/forms/select.md +15 -30
  57. package/data/forms/textarea.md +8 -21
  58. package/data/forms/timepicker.md +30 -42
  59. package/data/forms/toggle.md +18 -31
  60. package/data/plugins/charts.md +542 -526
  61. package/data/plugins/datatables.md +285 -286
  62. package/data/plugins/wysiwyg.md +658 -650
  63. package/data/quickstart.md +24 -24
  64. package/data/typography/blockquote.md +24 -37
  65. package/data/typography/headings.md +30 -43
  66. package/data/typography/hr.md +10 -23
  67. package/data/typography/images.md +32 -45
  68. package/data/typography/links.md +16 -29
  69. package/data/typography/lists.md +22 -35
  70. package/data/typography/paragraphs.md +30 -43
  71. package/data/typography/text.md +42 -55
  72. package/package.json +1 -1
@@ -1,17 +1,3 @@
1
- ---
2
- layout: docs
3
- title: Tailwind CSS Charts - Flowbite
4
- description: Use the chart and graph components from Flowbite built with Tailwind CSS and ApexCharts to choose from line, area, bar, column, pie, and radial charts and customize them using JavaScript
5
- group: plugins
6
- toc: true
7
- requires_js: true
8
-
9
- previous: Horizontal line (HR)
10
- previousLink: typography/hr/
11
- next: DataTables
12
- nextLink: plugins/datatables/
13
- ---
14
-
15
1
  The chart components from the Flowbite Library are open-source under the MIT license and they are styled with the utility classes from Tailwind CSS and based on the open-source [ApexCharts](https://apexcharts.com/) library.
16
2
 
17
3
  We provide an extensive collection of responsive chart types such as area, bar, column, pie, and radial that can help you visualize complex data inside graphs in admin dashboard layouts, analytics, diagrams, and more.
@@ -22,21 +8,21 @@ You can also easily customize the colors, sizes, and options of these charts eit
22
8
 
23
9
  Before continuing make sure that you have Tailwind CSS, Flowbite and ApexCharts installed in your project.
24
10
 
25
- 1. Follow the <a href="{{< ref "getting-started/quickstart" >}}">quickstart guide</a> from Flowbite to install the plugin styles and functionality
11
+ 1. Follow the quickstart guide from Flowbite to install the plugin styles and functionality
26
12
 
27
13
  2. Make sure that you have ApexCharts installed and configured in your project:
28
14
 
29
15
  Install ApexChart via NPM and save it in your `package.json` file:
30
16
 
31
- {{< code lang="bash" >}}
17
+ ```bash
32
18
  npm install apexcharts@3.46.0 --save
33
- {{< /code >}}
19
+ ```
34
20
 
35
21
  Alternatively, you can also just include the CDN link:
36
22
 
37
- {{< code lang="html" file="charts.html" icon="file" >}}
23
+ ```html
38
24
  <script src="https://cdn.jsdelivr.net/npm/apexcharts@3.46.0/dist/apexcharts.min.js"></script>
39
- {{< /code >}}
25
+ ```
40
26
 
41
27
  Now that you have all the libraries installed you can copy-paste the chart examples below in your code.
42
28
 
@@ -44,7 +30,56 @@ Now that you have all the libraries installed you can copy-paste the chart examp
44
30
 
45
31
  Use this example to show a basic area chart by setting the `type: "area"` option in JavaScript:
46
32
 
47
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
33
+ ```html
34
+ <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
35
+ <div class="flex justify-between items-start">
36
+ <div>
37
+ <h5 class="text-2xl font-semibold text-heading">32.4k</h5>
38
+ <p class="text-body">Users this week</p>
39
+ </div>
40
+ <div class="flex items-center px-2.5 py-0.5 font-medium text-fg-success text-center">
41
+ <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v13m0-13 4 4m-4-4-4 4"/></svg>
42
+ 12%
43
+ </div>
44
+ </div>
45
+ <div id="area-chart"></div>
46
+ <div class="grid grid-cols-1 items-center border-light border-t justify-between">
47
+ <div class="flex justify-between items-center pt-4 md:pt-6">
48
+ <!-- Button -->
49
+ <button id="dropdownDefaultButton" data-dropdown-toggle="lastDaysdropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
50
+ Last 7 days
51
+ <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
52
+ </button>
53
+ <!-- Dropdown menu -->
54
+ <div id="lastDaysdropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
55
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownDefaultButton">
56
+ <li>
57
+ <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
58
+ </li>
59
+ <li>
60
+ <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Today</a>
61
+ </li>
62
+ <li>
63
+ <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Last 7 days</a>
64
+ </li>
65
+ <li>
66
+ <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Last 30 days</a>
67
+ </li>
68
+ <li>
69
+ <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Last 90 days</a>
70
+ </li>
71
+ </ul>
72
+ </div>
73
+ <a href="#" class="inline-flex items-center text-fg-brand bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
74
+ Users Report
75
+ <svg class="w-4 h-4 ms-1.5 -me-0.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
76
+ </a>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ ```
81
+
82
+ ```javascript
48
83
  // Get the CSS variable --color-brand and convert it to hex for ApexCharts
49
84
  const getBrandColor = () => {
50
85
  // Get the computed style of the document's root element
@@ -127,28 +162,61 @@ if (document.getElementById("area-chart") && typeof ApexCharts !== 'undefined')
127
162
  const chart = new ApexCharts(document.getElementById("area-chart"), options);
128
163
  chart.render();
129
164
  }
130
- ` >}}
165
+ ```
166
+
167
+ ## Line chart
168
+
169
+ To create a double line chart check the example below by setting the chart type to `type: "line"` and copy the HTML markup and JS options to automatically style and populate the chart with data:
170
+
171
+ ```html
131
172
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
132
- <div class="flex justify-between items-start">
133
- <div>
134
- <h5 class="text-2xl font-semibold text-heading">32.4k</h5>
135
- <p class="text-body">Users this week</p>
136
- </div>
137
- <div class="flex items-center px-2.5 py-0.5 font-medium text-fg-success text-center">
138
- <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v13m0-13 4 4m-4-4-4 4"/></svg>
139
- 12%
173
+ <div class="flex justify-between mb-4 md:mb-6">
174
+ <div class="grid gap-4 grid-cols-2">
175
+ <div>
176
+ <h5 class="inline-flex items-center text-body">Clicks
177
+ <svg data-popover-target="clicks-info" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
178
+ <div data-popover id="clicks-info" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
179
+ <div>
180
+ <h3 class="font-semibold text-heading mb-2">Activity growth - Incremental</h3>
181
+ <p class="mb-4">Report helps navigate cumulative growth of community activities. Ideally, the chart should have a growing trend, as stagnating chart signifies a significant decrease of community activity.</p>
182
+ <h3 class="font-semibold text-heading mb-2">Calculation</h3>
183
+ <p class="mb-4">For each date bucket, the all-time volume of activities is calculated. This means that activities in period n contain all activities up to period n, plus the activities generated by your community in period.</p>
184
+ <a href="#" class="flex items-center font-medium text-fg-brand hover:underline">
185
+ Read more
186
+ <svg class="w-4 h-4 ms-1 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
187
+ </a>
188
+ </div>
189
+ <div data-popper-arrow></div>
190
+ </div>
191
+ </h5>
192
+ <p class="text-heading text-2xl font-semibold">42,3k</p>
193
+ </div>
194
+ <div>
195
+ <h5 class="inline-flex items-center text-body">CPC
196
+ <svg data-popover-target="cpc-info" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
197
+ <div data-popover id="cpc-info" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
198
+ <div>
199
+ <h3 class="font-semibold text-heading mb-2">CPC Info</h3>
200
+ <p class="mb-4">Report helps navigate cumulative growth of community activities. Ideally, the chart should have a growing trend, as stagnating chart signifies a significant decrease of community activity.</p>
201
+ <h3 class="font-semibold text-heading mb-2">Calculation</h3>
202
+ <p class="mb-4">For each date bucket, the all-time volume of activities is calculated. This means that activities in period n contain all activities up to period n, plus the activities generated by your community in period.</p>
203
+ <a href="#" class="flex items-center font-medium text-fg-brand hover:underline">
204
+ Read more
205
+ <svg class="w-4 h-4 ms-1 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
206
+ </a>
207
+ </div>
208
+ <div data-popper-arrow></div>
209
+ </div>
210
+ </h5>
211
+ <p class="text-heading text-2xl font-semibold">$5.40</p>
212
+ </div>
140
213
  </div>
141
- </div>
142
- <div id="area-chart"></div>
143
- <div class="grid grid-cols-1 items-center border-light border-t justify-between">
144
- <div class="flex justify-between items-center pt-4 md:pt-6">
145
- <!-- Button -->
146
- <button id="dropdownDefaultButton" data-dropdown-toggle="lastDaysdropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
147
- Last 7 days
148
- <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
149
- </button>
150
- <!-- Dropdown menu -->
151
- <div id="lastDaysdropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
214
+ <div>
215
+ <button id="dropdownDefaultButton" data-dropdown-toggle="lastDaysdropdown" data-dropdown-placement="bottom" type="button" class="inline-flex items-center text-body bg-neutral-secondary-medium box-border border border-default-medium hover:bg-neutral-tertiary-medium hover:text-heading focus:ring-4 focus:ring-neutral-tertiary shadow-xs font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
216
+ Last week
217
+ <svg class="w-4 h-4 ms-1.5 -me-0.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
218
+ </button>
219
+ <div id="lastDaysdropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
152
220
  <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownDefaultButton">
153
221
  <li>
154
222
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
@@ -167,20 +235,19 @@ if (document.getElementById("area-chart") && typeof ApexCharts !== 'undefined')
167
235
  </li>
168
236
  </ul>
169
237
  </div>
170
- <a href="#" class="inline-flex items-center text-fg-brand bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
171
- Users Report
172
- <svg class="w-4 h-4 ms-1.5 -me-0.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
173
- </a>
174
238
  </div>
175
239
  </div>
240
+ <div id="line-chart"></div>
241
+ <div class="items-center border-light border-t justify-between mt-4 md:mt-6 pt-4 md:pt-6">
242
+ <button type="button" class="inline-flex items-center text-white bg-brand hover:bg-brand-strong box-border border border-transparent focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
243
+ <svg class="w-4 h-4 me-1.5 -ms-0.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 3v4a1 1 0 0 1-1 1H5m4 10v-2m3 2v-6m3 6v-3m4-11v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V7.914a1 1 0 0 1 .293-.707l3.914-3.914A1 1 0 0 1 9.914 3H18a1 1 0 0 1 1 1Z"/></svg>
244
+ View full report
245
+ </button>
246
+ </div>
176
247
  </div>
177
- {{< /example >}}
178
-
179
- ## Line chart
180
-
181
- To create a double line chart check the example below by setting the chart type to `type: "line"` and copy the HTML markup and JS options to automatically style and populate the chart with data:
248
+ ```
182
249
 
183
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
250
+ ```javascript
184
251
  // Get the CSS variable --color-brand and convert it to hex for ApexCharts
185
252
  const getBrandColor = () => {
186
253
  // Get the computed style of the document's root element
@@ -275,56 +342,53 @@ if (document.getElementById("line-chart") && typeof ApexCharts !== 'undefined')
275
342
  const chart = new ApexCharts(document.getElementById("line-chart"), options);
276
343
  chart.render();
277
344
  }
278
- ` >}}
345
+ ```
346
+
347
+ ## Column chart
348
+
349
+ You can represent multiple data entries using columns by setting the `type: "bar"` option and also by updating the `horizontal` key value to `false` in JavaScript to adjust them vertically as columns:
350
+
351
+ ```html
279
352
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
280
- <div class="flex justify-between mb-4 md:mb-6">
281
- <div class="grid gap-4 grid-cols-2">
282
- <div>
283
- <h5 class="inline-flex items-center text-body">Clicks
284
- <svg data-popover-target="clicks-info" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
285
- <div data-popover id="clicks-info" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
286
- <div>
287
- <h3 class="font-semibold text-heading mb-2">Activity growth - Incremental</h3>
288
- <p class="mb-4">Report helps navigate cumulative growth of community activities. Ideally, the chart should have a growing trend, as stagnating chart signifies a significant decrease of community activity.</p>
289
- <h3 class="font-semibold text-heading mb-2">Calculation</h3>
290
- <p class="mb-4">For each date bucket, the all-time volume of activities is calculated. This means that activities in period n contain all activities up to period n, plus the activities generated by your community in period.</p>
291
- <a href="#" class="flex items-center font-medium text-fg-brand hover:underline">
292
- Read more
293
- <svg class="w-4 h-4 ms-1 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
294
- </a>
295
- </div>
296
- <div data-popper-arrow></div>
297
- </div>
298
- </h5>
299
- <p class="text-heading text-2xl font-semibold">42,3k</p>
353
+ <div class="flex justify-between pb-4 mb-4 border-b border-light">
354
+ <div class="flex items-center">
355
+ <div class="w-12 h-12 bg-neutral-primary-medium border border-default-medium flex items-center justify-center rounded-full me-3">
356
+ <svg class="w-7 h-7 text-body" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M4.5 17H4a1 1 0 0 1-1-1 3 3 0 0 1 3-3h1m0-3.05A2.5 2.5 0 1 1 9 5.5M19.5 17h.5a1 1 0 0 0 1-1 3 3 0 0 0-3-3h-1m0-3.05a2.5 2.5 0 1 0-2-4.45m.5 13.5h-7a1 1 0 0 1-1-1 3 3 0 0 1 3-3h3a3 3 0 0 1 3 3 1 1 0 0 1-1 1Zm-1-9.5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"/></svg>
300
357
  </div>
301
358
  <div>
302
- <h5 class="inline-flex items-center text-body">CPC
303
- <svg data-popover-target="cpc-info" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
304
- <div data-popover id="cpc-info" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
305
- <div>
306
- <h3 class="font-semibold text-heading mb-2">CPC Info</h3>
307
- <p class="mb-4">Report helps navigate cumulative growth of community activities. Ideally, the chart should have a growing trend, as stagnating chart signifies a significant decrease of community activity.</p>
308
- <h3 class="font-semibold text-heading mb-2">Calculation</h3>
309
- <p class="mb-4">For each date bucket, the all-time volume of activities is calculated. This means that activities in period n contain all activities up to period n, plus the activities generated by your community in period.</p>
310
- <a href="#" class="flex items-center font-medium text-fg-brand hover:underline">
311
- Read more
312
- <svg class="w-4 h-4 ms-1 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
313
- </a>
314
- </div>
315
- <div data-popper-arrow></div>
316
- </div>
317
- </h5>
318
- <p class="text-heading text-2xl font-semibold">$5.40</p>
359
+ <h5 class="text-2xl font-semibold text-heading">3.4k</h5>
360
+ <p class="text-sm text-body">Leads generated per week</p>
319
361
  </div>
320
362
  </div>
321
363
  <div>
322
- <button id="dropdownDefaultButton" data-dropdown-toggle="lastDaysdropdown" data-dropdown-placement="bottom" type="button" class="inline-flex items-center text-body bg-neutral-secondary-medium box-border border border-default-medium hover:bg-neutral-tertiary-medium hover:text-heading focus:ring-4 focus:ring-neutral-tertiary shadow-xs font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
323
- Last week
324
- <svg class="w-4 h-4 ms-1.5 -me-0.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
325
- </button>
326
- <div id="lastDaysdropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
327
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownDefaultButton">
364
+ <span class="inline-flex items-center bg-success-soft border border-success-subtle text-fg-success-strong text-xs font-medium px-1.5 py-0.5 rounded">
365
+ <svg class="w-4 h-4 me-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v13m0-13 4 4m-4-4-4 4"/></svg>
366
+ 42.5%
367
+ </span>
368
+ </div>
369
+ </div>
370
+
371
+ <div class="grid grid-cols-2">
372
+ <dl class="flex items-center">
373
+ <dt class="text-body text-sm font-normal me-1">Money spent:</dt>
374
+ <dd class="text-heading text-sm font-semibold">$3,232</dd>
375
+ </dl>
376
+ <dl class="flex items-center justify-end">
377
+ <dt class="text-body text-sm font-normal me-1">Conversion:</dt>
378
+ <dd class="text-heading text-sm font-semibold">1.2%</dd>
379
+ </dl>
380
+ </div>
381
+ <div id="column-chart"></div>
382
+ <div class="grid grid-cols-1 items-center border-light border-t justify-between">
383
+ <div class="flex justify-between items-center pt-4 md:pt-6">
384
+ <!-- Button -->
385
+ <button id="dropdownLastDaysButton" data-dropdown-toggle="LastDaysdropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
386
+ Last 7 days
387
+ <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
388
+ </button>
389
+ <!-- Dropdown menu -->
390
+ <div id="LastDaysdropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
391
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDaysButton">
328
392
  <li>
329
393
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
330
394
  </li>
@@ -342,24 +406,17 @@ if (document.getElementById("line-chart") && typeof ApexCharts !== 'undefined')
342
406
  </li>
343
407
  </ul>
344
408
  </div>
409
+ <a href="#" class="inline-flex items-center text-fg-brand bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
410
+ Leads Report
411
+ <svg class="w-4 h-4 ms-1.5 -me-0.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
412
+ </a>
345
413
  </div>
346
414
  </div>
347
- <div id="line-chart"></div>
348
- <div class="items-center border-light border-t justify-between mt-4 md:mt-6 pt-4 md:pt-6">
349
- <button type="button" class="inline-flex items-center text-white bg-brand hover:bg-brand-strong box-border border border-transparent focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
350
- <svg class="w-4 h-4 me-1.5 -ms-0.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 3v4a1 1 0 0 1-1 1H5m4 10v-2m3 2v-6m3 6v-3m4-11v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V7.914a1 1 0 0 1 .293-.707l3.914-3.914A1 1 0 0 1 9.914 3H18a1 1 0 0 1 1 1Z"/></svg>
351
- View full report
352
- </button>
353
- </div>
354
415
  </div>
355
- {{< /example >}}
356
-
357
- ## Column chart
416
+ ```
358
417
 
359
- You can represent multiple data entries using columns by setting the `type: "bar"` option and also by updating the `horizontal` key value to `false` in JavaScript to adjust them vertically as columns:
360
-
361
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
362
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
418
+ ```javascript
419
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
363
420
  const getBrandColor = () => {
364
421
  // Get the computed style of the document's root element
365
422
  const computedStyle = getComputedStyle(document.documentElement);
@@ -485,47 +542,50 @@ You can represent multiple data entries using columns by setting the `type: "bar
485
542
  const chart = new ApexCharts(document.getElementById("column-chart"), options);
486
543
  chart.render();
487
544
  }
488
- ` >}}
545
+ ```
546
+
547
+ ## Bar chart
548
+
549
+ Create a horizontal bar chart with as many data series as you like by setting the `type: "bar"` chart type via JavaScript and copy the example below into your project. You can enable or disable the labels on the X or Y axis by setting `show` to `false` for the `xaxis` and `yaxis` objects of the chart options.
550
+
551
+ ```html
489
552
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
490
- <div class="flex justify-between pb-4 mb-4 border-b border-light">
491
- <div class="flex items-center">
492
- <div class="w-12 h-12 bg-neutral-primary-medium border border-default-medium flex items-center justify-center rounded-full me-3">
493
- <svg class="w-7 h-7 text-body" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M4.5 17H4a1 1 0 0 1-1-1 3 3 0 0 1 3-3h1m0-3.05A2.5 2.5 0 1 1 9 5.5M19.5 17h.5a1 1 0 0 0 1-1 3 3 0 0 0-3-3h-1m0-3.05a2.5 2.5 0 1 0-2-4.45m.5 13.5h-7a1 1 0 0 1-1-1 3 3 0 0 1 3-3h3a3 3 0 0 1 3 3 1 1 0 0 1-1 1Zm-1-9.5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"/></svg>
494
- </div>
495
- <div>
496
- <h5 class="text-2xl font-semibold text-heading">3.4k</h5>
497
- <p class="text-sm text-body">Leads generated per week</p>
498
- </div>
499
- </div>
553
+ <div class="flex justify-between border-light border-b pb-3">
554
+ <dl>
555
+ <dt class="text-body">Profit</dt>
556
+ <dd class="text-2xl font-semibold text-heading">$5,405</dd>
557
+ </dl>
500
558
  <div>
501
559
  <span class="inline-flex items-center bg-success-soft border border-success-subtle text-fg-success-strong text-xs font-medium px-1.5 py-0.5 rounded">
502
560
  <svg class="w-4 h-4 me-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v13m0-13 4 4m-4-4-4 4"/></svg>
503
- 42.5%
561
+ Profit rate 23.5%
504
562
  </span>
505
563
  </div>
506
564
  </div>
507
565
 
508
- <div class="grid grid-cols-2">
509
- <dl class="flex items-center">
510
- <dt class="text-body text-sm font-normal me-1">Money spent:</dt>
511
- <dd class="text-heading text-sm font-semibold">$3,232</dd>
566
+ <div class="grid grid-cols-2 py-3">
567
+ <dl>
568
+ <dt class="text-body">Income</dt>
569
+ <dd class="text-lg font-semibold text-fg-success">$23,635</dd>
512
570
  </dl>
513
- <dl class="flex items-center justify-end">
514
- <dt class="text-body text-sm font-normal me-1">Conversion:</dt>
515
- <dd class="text-heading text-sm font-semibold">1.2%</dd>
571
+ <dl>
572
+ <dt class="text-body">Expense</dt>
573
+ <dd class="text-lg font-semibold text-fg-danger">-$18,230</dd>
516
574
  </dl>
517
575
  </div>
518
- <div id="column-chart"></div>
576
+
577
+ <div id="bar-chart"></div>
578
+
519
579
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
520
580
  <div class="flex justify-between items-center pt-4 md:pt-6">
521
581
  <!-- Button -->
522
- <button id="dropdownLastDaysButton" data-dropdown-toggle="LastDaysdropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
582
+ <button id="dropdownLastDays3Button" data-dropdown-toggle="LastDays3dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
523
583
  Last 7 days
524
584
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
525
585
  </button>
526
586
  <!-- Dropdown menu -->
527
- <div id="LastDaysdropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
528
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDaysButton">
587
+ <div id="LastDays3dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
588
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays3Button">
529
589
  <li>
530
590
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
531
591
  </li>
@@ -544,19 +604,15 @@ You can represent multiple data entries using columns by setting the `type: "bar
544
604
  </ul>
545
605
  </div>
546
606
  <a href="#" class="inline-flex items-center text-fg-brand bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
547
- Leads Report
607
+ Revenue Report
548
608
  <svg class="w-4 h-4 ms-1.5 -me-0.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
549
609
  </a>
550
610
  </div>
551
611
  </div>
552
612
  </div>
553
- {{< /example >}}
613
+ ```
554
614
 
555
- ## Bar chart
556
-
557
- Create a horizontal bar chart with as many data series as you like by setting the `type: "bar"` chart type via JavaScript and copy the example below into your project. You can enable or disable the labels on the X or Y axis by setting `show` to `false` for the `xaxis` and `yaxis` objects of the chart options.
558
-
559
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
615
+ ```javascript
560
616
  const options = {
561
617
  series: [
562
618
  {
@@ -655,44 +711,105 @@ if(document.getElementById("bar-chart") && typeof ApexCharts !== 'undefined') {
655
711
  const chart = new ApexCharts(document.getElementById("bar-chart"), options);
656
712
  chart.render();
657
713
  }
658
- ` >}}
714
+ ```
715
+
716
+ ## Pie chart
717
+
718
+ Create a pie chart with multiple data series by setting the `type: "pie"` chart type option via JavaScript and copy the following HTML markup code and options from below:
719
+
720
+ ```html
659
721
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
660
- <div class="flex justify-between border-light border-b pb-3">
661
- <dl>
662
- <dt class="text-body">Profit</dt>
663
- <dd class="text-2xl font-semibold text-heading">$5,405</dd>
664
- </dl>
665
- <div>
666
- <span class="inline-flex items-center bg-success-soft border border-success-subtle text-fg-success-strong text-xs font-medium px-1.5 py-0.5 rounded">
667
- <svg class="w-4 h-4 me-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v13m0-13 4 4m-4-4-4 4"/></svg>
668
- Profit rate 23.5%
669
- </span>
722
+
723
+ <div class="flex justify-between items-start w-full">
724
+ <div class="flex-col items-center">
725
+ <div class="flex items-center mb-1">
726
+ <h5 class="text-xl font-semibold text-heading me-1">Website traffic</h5>
727
+ <svg data-popover-target="traffic-info" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
728
+ <div data-popover id="traffic-info" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
729
+ <div>
730
+ <h3 class="font-semibold text-heading mb-2">Activity growth - Incremental</h3>
731
+ <p class="mb-4">Report helps navigate cumulative growth of community activities. Ideally, the chart should have a growing trend, as stagnating chart signifies a significant decrease of community activity.</p>
732
+ <h3 class="font-semibold text-heading mb-2">Calculation</h3>
733
+ <p class="mb-4">For each date bucket, the all-time volume of activities is calculated. This means that activities in period n contain all activities up to period n, plus the activities generated by your community in period.</p>
734
+ <a href="#" class="flex items-center font-medium text-fg-brand hover:underline">
735
+ Read more
736
+ <svg class="w-4 h-4 ms-1 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
737
+ </a>
738
+ </div>
739
+ <div data-popper-arrow></div>
740
+ </div>
741
+ </div>
742
+ <button id="dateRangeButton" data-dropdown-toggle="dateRangeDropdown" data-dropdown-ignore-click-outside-class="datepicker" type="button" class="inline-flex items-center text-fg-brand font-medium hover:underline">
743
+ 31 Nov - 31 Dev
744
+ <svg class="w-4.5 h-4.5 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
745
+ </button>
746
+ <div id="dateRangeDropdown" class="z-10 hidden bg-neutral-primary-soft rounded-base shadow-xs border border-default w-80 lg:w-112">
747
+ <div id="date-range-picker" date-rangepicker class="flex items-center p-2">
748
+ <div class="relative">
749
+ <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
750
+ <svg class="w-4 h-4 text-body" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10h16m-8-3V4M7 7V4m10 3V4M5 20h14a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Zm3-7h.01v.01H8V13Zm4 0h.01v.01H12V13Zm4 0h.01v.01H16V13Zm-8 4h.01v.01H8V17Zm4 0h.01v.01H12V17Zm4 0h.01v.01H16V17Z"/></svg>
751
+ </div>
752
+ <input id="datepicker-range-start" name="start" type="text" class="block w-full ps-9 pe-3 py-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="Start date">
753
+ </div>
754
+ <span class="mx-4 text-body">to</span>
755
+ <div class="relative">
756
+ <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
757
+ <svg class="w-4 h-4 text-body" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10h16m-8-3V4M7 7V4m10 3V4M5 20h14a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Zm3-7h.01v.01H8V13Zm4 0h.01v.01H12V13Zm4 0h.01v.01H16V13Zm-8 4h.01v.01H8V17Zm4 0h.01v.01H12V17Zm4 0h.01v.01H16V17Z"/></svg>
758
+ </div>
759
+ <input id="datepicker-range-end" name="end" type="text" class="block w-full ps-9 pe-3 py-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="End date">
760
+ </div>
761
+ </div>
762
+ </div>
763
+ </div>
764
+ <div class="flex justify-end items-center">
765
+ <button id="widgetDropdownButton" data-dropdown-toggle="widgetDropdown" data-dropdown-placement="bottom" type="button" class="inline-flex items-center justify-center text-body bg-neutral-primary-soft hover:bg-neutral-tertiary hover:text-heading focus:ring-4 focus:ring-neutral-tertiary shadow-xs font-medium leading-5 rounded-base text-sm w-9 h-9 focus:outline-none">
766
+ <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="3" d="M6 12h.01m6 0h.01m5.99 0h.01"/></svg>
767
+ <span class="sr-only">Open dropdown</span>
768
+ </button>
769
+ <div id="widgetDropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
770
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="widgetDropdownButton">
771
+ <li>
772
+ <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">
773
+ <svg class="w-4 h-4 me-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 5V4a1 1 0 0 0-1-1H8.914a1 1 0 0 0-.707.293L4.293 7.207A1 1 0 0 0 4 7.914V20a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5M9 3v4a1 1 0 0 1-1 1H4m11.383.772 2.745 2.746m1.215-3.906a2.089 2.089 0 0 1 0 2.953l-6.65 6.646L9 17.95l.739-3.692 6.646-6.646a2.087 2.087 0 0 1 2.958 0Z"/></svg>
774
+ Edit widget
775
+ </a>
776
+ </li>
777
+ <li>
778
+ <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">
779
+ <svg class="w-4 h-4 me-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 13V4M7 14H5a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2m-1-5-4 5-4-5m9 8h.01"/></svg>
780
+ Download data
781
+ </a>
782
+ </li>
783
+ <li>
784
+ <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">
785
+ <svg class="w-4 h-4 me-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8v8m0-8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm8-8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 0a4 4 0 0 1-4 4h-1a3 3 0 0 0-3 3"/></svg>
786
+ Add to repository
787
+ </a>
788
+ </li>
789
+ <li>
790
+ <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">
791
+ <svg class="w-4 h-4 me-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"/></svg>
792
+ Delete widget
793
+ </a>
794
+ </li>
795
+ </ul>
670
796
  </div>
671
797
  </div>
672
-
673
- <div class="grid grid-cols-2 py-3">
674
- <dl>
675
- <dt class="text-body">Income</dt>
676
- <dd class="text-lg font-semibold text-fg-success">$23,635</dd>
677
- </dl>
678
- <dl>
679
- <dt class="text-body">Expense</dt>
680
- <dd class="text-lg font-semibold text-fg-danger">-$18,230</dd>
681
- </dl>
682
798
  </div>
683
799
 
684
- <div id="bar-chart"></div>
685
-
800
+ <!-- Line Chart -->
801
+ <div class="py-6" id="pie-chart"></div>
802
+
686
803
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
687
804
  <div class="flex justify-between items-center pt-4 md:pt-6">
688
805
  <!-- Button -->
689
- <button id="dropdownLastDays3Button" data-dropdown-toggle="LastDays3dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
806
+ <button id="dropdownLastDays4Button" data-dropdown-toggle="LastDays4dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
690
807
  Last 7 days
691
808
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
692
809
  </button>
693
810
  <!-- Dropdown menu -->
694
- <div id="LastDays3dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
695
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays3Button">
811
+ <div id="LastDays4dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
812
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays4Button">
696
813
  <li>
697
814
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
698
815
  </li>
@@ -711,20 +828,17 @@ if(document.getElementById("bar-chart") && typeof ApexCharts !== 'undefined') {
711
828
  </ul>
712
829
  </div>
713
830
  <a href="#" class="inline-flex items-center text-fg-brand bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
714
- Revenue Report
831
+ Traffic Report
715
832
  <svg class="w-4 h-4 ms-1.5 -me-0.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
716
833
  </a>
717
834
  </div>
718
835
  </div>
719
- </div>
720
- {{< /example >}}
721
836
 
722
- ## Pie chart
723
-
724
- Create a pie chart with multiple data series by setting the `type: "pie"` chart type option via JavaScript and copy the following HTML markup code and options from below:
837
+ </div>
838
+ ```
725
839
 
726
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
727
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
840
+ ```javascript
841
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
728
842
  const getBrandColor = () => {
729
843
  // Get the computed style of the document's root element
730
844
  const computedStyle = getComputedStyle(document.documentElement);
@@ -815,99 +929,77 @@ Create a pie chart with multiple data series by setting the `type: "pie"` chart
815
929
  const chart = new ApexCharts(document.getElementById("pie-chart"), getChartOptions());
816
930
  chart.render();
817
931
  }
818
- ` >}}
819
- <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
932
+ ```
820
933
 
821
- <div class="flex justify-between items-start w-full">
822
- <div class="flex-col items-center">
823
- <div class="flex items-center mb-1">
934
+ ## Donut chart
935
+
936
+ Set the JavaScript API option to `type: "donut"` to create a donut chart and copy the options from the example below to style the elements such as the data series, legends and labels for the X and Y axis.
937
+
938
+ In this example we also show how you can set event listeners on the UI components from Flowbite to update the data series from the chart by clicking the device checkboxes.
939
+
940
+ ```html
941
+ <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
942
+
943
+ <div class="flex justify-between mb-3">
944
+ <div class="flex justify-center items-center">
824
945
  <h5 class="text-xl font-semibold text-heading me-1">Website traffic</h5>
825
- <svg data-popover-target="traffic-info" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
826
- <div data-popover id="traffic-info" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
827
- <div>
828
- <h3 class="font-semibold text-heading mb-2">Activity growth - Incremental</h3>
829
- <p class="mb-4">Report helps navigate cumulative growth of community activities. Ideally, the chart should have a growing trend, as stagnating chart signifies a significant decrease of community activity.</p>
830
- <h3 class="font-semibold text-heading mb-2">Calculation</h3>
831
- <p class="mb-4">For each date bucket, the all-time volume of activities is calculated. This means that activities in period n contain all activities up to period n, plus the activities generated by your community in period.</p>
832
- <a href="#" class="flex items-center font-medium text-fg-brand hover:underline">
833
- Read more
834
- <svg class="w-4 h-4 ms-1 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
835
- </a>
836
- </div>
837
- <div data-popper-arrow></div>
946
+ <svg data-popover-target="traffic-info-2" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
947
+ <div data-popover id="traffic-info-2" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
948
+ <div>
949
+ <h3 class="font-semibold text-heading mb-2">Activity growth - Incremental</h3>
950
+ <p class="mb-4">Report helps navigate cumulative growth of community activities. Ideally, the chart should have a growing trend, as stagnating chart signifies a significant decrease of community activity.</p>
951
+ <h3 class="font-semibold text-heading mb-2">Calculation</h3>
952
+ <p class="mb-4">For each date bucket, the all-time volume of activities is calculated. This means that activities in period n contain all activities up to period n, plus the activities generated by your community in period.</p>
953
+ <a href="#" class="flex items-center font-medium text-fg-brand hover:underline">
954
+ Read more
955
+ <svg class="w-4 h-4 ms-1 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
956
+ </a>
838
957
  </div>
839
- </div>
840
- <button id="dateRangeButton" data-dropdown-toggle="dateRangeDropdown" data-dropdown-ignore-click-outside-class="datepicker" type="button" class="inline-flex items-center text-fg-brand font-medium hover:underline">
841
- 31 Nov - 31 Dev
842
- <svg class="w-4.5 h-4.5 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
843
- </button>
844
- <div id="dateRangeDropdown" class="z-10 hidden bg-neutral-primary-soft rounded-base shadow-xs border border-default w-80 lg:w-112">
845
- <div id="date-range-picker" date-rangepicker class="flex items-center p-2">
846
- <div class="relative">
847
- <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
848
- <svg class="w-4 h-4 text-body" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10h16m-8-3V4M7 7V4m10 3V4M5 20h14a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Zm3-7h.01v.01H8V13Zm4 0h.01v.01H12V13Zm4 0h.01v.01H16V13Zm-8 4h.01v.01H8V17Zm4 0h.01v.01H12V17Zm4 0h.01v.01H16V17Z"/></svg>
849
- </div>
850
- <input id="datepicker-range-start" name="start" type="text" class="block w-full ps-9 pe-3 py-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="Start date">
958
+ <div data-popper-arrow></div>
851
959
  </div>
852
- <span class="mx-4 text-body">to</span>
853
- <div class="relative">
854
- <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
855
- <svg class="w-4 h-4 text-body" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10h16m-8-3V4M7 7V4m10 3V4M5 20h14a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Zm3-7h.01v.01H8V13Zm4 0h.01v.01H12V13Zm4 0h.01v.01H16V13Zm-8 4h.01v.01H8V17Zm4 0h.01v.01H12V17Zm4 0h.01v.01H16V17Z"/></svg>
856
- </div>
857
- <input id="datepicker-range-end" name="end" type="text" class="block w-full ps-9 pe-3 py-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand px-3 py-2.5 shadow-xs placeholder:text-body" placeholder="End date">
858
960
  </div>
961
+ <div>
962
+ <button type="button" data-tooltip-target="data-tooltip" data-tooltip-placement="bottom" class="hidden sm:inline-flex items-center justify-center text-body hover:text-heading bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm w-9 h-9 focus:outline-none">
963
+ <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 15v2a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-2m-8 1V4m0 12-4-4m4 4 4-4"/></svg>
964
+ <span class="sr-only">Download data</span>
965
+ </button>
966
+ <div id="data-tooltip" role="tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-dark rounded-base shadow-xs opacity-0 tooltip">
967
+ Download CSV
968
+ <div class="tooltip-arrow" data-popper-arrow></div>
859
969
  </div>
860
970
  </div>
861
- </div>
862
- <div class="flex justify-end items-center">
863
- <button id="widgetDropdownButton" data-dropdown-toggle="widgetDropdown" data-dropdown-placement="bottom" type="button" class="inline-flex items-center justify-center text-body bg-neutral-primary-soft hover:bg-neutral-tertiary hover:text-heading focus:ring-4 focus:ring-neutral-tertiary shadow-xs font-medium leading-5 rounded-base text-sm w-9 h-9 focus:outline-none">
864
- <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="3" d="M6 12h.01m6 0h.01m5.99 0h.01"/></svg>
865
- <span class="sr-only">Open dropdown</span>
866
- </button>
867
- <div id="widgetDropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
868
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="widgetDropdownButton">
869
- <li>
870
- <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">
871
- <svg class="w-4 h-4 me-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 5V4a1 1 0 0 0-1-1H8.914a1 1 0 0 0-.707.293L4.293 7.207A1 1 0 0 0 4 7.914V20a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5M9 3v4a1 1 0 0 1-1 1H4m11.383.772 2.745 2.746m1.215-3.906a2.089 2.089 0 0 1 0 2.953l-6.65 6.646L9 17.95l.739-3.692 6.646-6.646a2.087 2.087 0 0 1 2.958 0Z"/></svg>
872
- Edit widget
873
- </a>
874
- </li>
875
- <li>
876
- <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">
877
- <svg class="w-4 h-4 me-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 13V4M7 14H5a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2m-1-5-4 5-4-5m9 8h.01"/></svg>
878
- Download data
879
- </a>
880
- </li>
881
- <li>
882
- <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">
883
- <svg class="w-4 h-4 me-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8v8m0-8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm8-8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 0a4 4 0 0 1-4 4h-1a3 3 0 0 0-3 3"/></svg>
884
- Add to repository
885
- </a>
886
- </li>
887
- <li>
888
- <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">
889
- <svg class="w-4 h-4 me-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"/></svg>
890
- Delete widget
891
- </a>
892
- </li>
893
- </ul>
894
- </div>
895
971
  </div>
972
+
973
+ <div>
974
+ <div class="flex" id="devices">
975
+ <div class="flex items-center me-4">
976
+ <input id="desktop" type="checkbox" value="desktop" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
977
+ <label for="desktop" class="select-none ms-2 text-sm font-medium text-heading">Desktop</label>
978
+ </div>
979
+ <div class="flex items-center me-4">
980
+ <input id="tablet" type="checkbox" value="tablet" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
981
+ <label for="tablet" class="select-none ms-2 text-sm font-medium text-heading">Tablet</label>
982
+ </div>
983
+ <div class="flex items-center me-4">
984
+ <input id="mobile" type="checkbox" value="mobile" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
985
+ <label for="mobile" class="select-none ms-2 text-sm font-medium text-heading">Mobile</label>
986
+ </div>
987
+ </div>
896
988
  </div>
897
989
 
898
- <!-- Line Chart -->
899
- <div class="py-6" id="pie-chart"></div>
990
+ <!-- Donut Chart -->
991
+ <div class="py-6" id="donut-chart"></div>
900
992
 
901
993
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
902
994
  <div class="flex justify-between items-center pt-4 md:pt-6">
903
995
  <!-- Button -->
904
- <button id="dropdownLastDays4Button" data-dropdown-toggle="LastDays4dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
996
+ <button id="dropdownLastDays5Button" data-dropdown-toggle="LastDays5dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
905
997
  Last 7 days
906
998
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
907
999
  </button>
908
1000
  <!-- Dropdown menu -->
909
- <div id="LastDays4dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
910
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays4Button">
1001
+ <div id="LastDays5dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1002
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays5Button">
911
1003
  <li>
912
1004
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
913
1005
  </li>
@@ -926,23 +1018,16 @@ Create a pie chart with multiple data series by setting the `type: "pie"` chart
926
1018
  </ul>
927
1019
  </div>
928
1020
  <a href="#" class="inline-flex items-center text-fg-brand bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
929
- Traffic Report
1021
+ Traffic analysis
930
1022
  <svg class="w-4 h-4 ms-1.5 -me-0.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
931
1023
  </a>
932
1024
  </div>
933
1025
  </div>
934
-
935
1026
  </div>
936
- {{< /example >}}
937
-
938
- ## Donut chart
939
-
940
- Set the JavaScript API option to `type: "donut"` to create a donut chart and copy the options from the example below to style the elements such as the data series, legends and labels for the X and Y axis.
941
-
942
- In this example we also show how you can set event listeners on the UI components from Flowbite to update the data series from the chart by clicking the device checkboxes.
1027
+ ```
943
1028
 
944
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
945
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1029
+ ```javascript
1030
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
946
1031
  const getBrandColor = () => {
947
1032
  // Get the computed style of the document's root element
948
1033
  const computedStyle = getComputedStyle(document.documentElement);
@@ -1084,14 +1169,20 @@ In this example we also show how you can set event listeners on the UI component
1084
1169
  checkbox.addEventListener('change', (event) => handleCheckboxChange(event, chart));
1085
1170
  });
1086
1171
  }
1087
- ` >}}
1172
+ ```
1173
+
1174
+ ## Radial chart
1175
+
1176
+ To create a radial chart with multiple data entries you need to set the `type: "radialBar"` when initialising a new chart and introduce multiple series and labels to the options and copy the following code:
1177
+
1178
+ ```html
1088
1179
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
1089
-
1090
- <div class="flex justify-between mb-3">
1091
- <div class="flex justify-center items-center">
1092
- <h5 class="text-xl font-semibold text-heading me-1">Website traffic</h5>
1093
- <svg data-popover-target="traffic-info-2" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
1094
- <div data-popover id="traffic-info-2" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
1180
+ <div class="flex justify-between mb-4 md:mb-6">
1181
+ <div class="flex items-center">
1182
+ <div class="flex justify-center items-center">
1183
+ <h5 class="text-xl font-semibold text-heading me-1">Your team's progress</h5>
1184
+ <svg data-popover-target="team-progress-2" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
1185
+ <div data-popover id="team-progress-2" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
1095
1186
  <div>
1096
1187
  <h3 class="font-semibold text-heading mb-2">Activity growth - Incremental</h3>
1097
1188
  <p class="mb-4">Report helps navigate cumulative growth of community activities. Ideally, the chart should have a growing trend, as stagnating chart signifies a significant decrease of community activity.</p>
@@ -1103,50 +1194,65 @@ In this example we also show how you can set event listeners on the UI component
1103
1194
  </a>
1104
1195
  </div>
1105
1196
  <div data-popper-arrow></div>
1106
- </div>
1107
- </div>
1108
- <div>
1109
- <button type="button" data-tooltip-target="data-tooltip" data-tooltip-placement="bottom" class="hidden sm:inline-flex items-center justify-center text-body hover:text-heading bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm w-9 h-9 focus:outline-none">
1110
- <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 15v2a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-2m-8 1V4m0 12-4-4m4 4 4-4"/></svg>
1111
- <span class="sr-only">Download data</span>
1112
- </button>
1113
- <div id="data-tooltip" role="tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-dark rounded-base shadow-xs opacity-0 tooltip">
1114
- Download CSV
1115
- <div class="tooltip-arrow" data-popper-arrow></div>
1116
1197
  </div>
1117
1198
  </div>
1199
+ </div>
1118
1200
  </div>
1119
1201
 
1120
- <div>
1121
- <div class="flex" id="devices">
1122
- <div class="flex items-center me-4">
1123
- <input id="desktop" type="checkbox" value="desktop" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
1124
- <label for="desktop" class="select-none ms-2 text-sm font-medium text-heading">Desktop</label>
1125
- </div>
1126
- <div class="flex items-center me-4">
1127
- <input id="tablet" type="checkbox" value="tablet" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
1128
- <label for="tablet" class="select-none ms-2 text-sm font-medium text-heading">Tablet</label>
1129
- </div>
1130
- <div class="flex items-center me-4">
1131
- <input id="mobile" type="checkbox" value="mobile" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
1132
- <label for="mobile" class="select-none ms-2 text-sm font-medium text-heading">Mobile</label>
1133
- </div>
1202
+ <div class="bg-neutral-secondary-medium border border-light-medium p-3 rounded-base">
1203
+ <div class="grid grid-cols-3 gap-3 mb-3">
1204
+ <dl class="bg-brand-softer border border-brand-subtle text-fg-brand-strong rounded-base flex flex-col items-center justify-center h-[78px]">
1205
+ <dt class="w-8 h-8 rounded-full bg-brand-soft text-fg-brand-strong text-sm font-medium flex items-center justify-center mb-1">12</dt>
1206
+ <dd class="text-fg-brand text-sm font-medium">To do</dd>
1207
+ </dl>
1208
+ <dl class="bg-warning-soft border border-warning-subtle text-fg-warning rounded-base flex flex-col items-center justify-center h-[78px]">
1209
+ <dt class="w-8 h-8 rounded-full bg-warning-medium text-fg-warning text-sm font-medium flex items-center justify-center mb-1">23</dt>
1210
+ <dd class="text-fg-warning text-sm font-medium">In progress</dd>
1211
+ </dl>
1212
+ <dl class="bg-success-soft border border-success-subtle text-fg-success-strong rounded-base flex flex-col items-center justify-center h-[78px]">
1213
+ <dt class="w-8 h-8 rounded-full bg-success-medium text-fg-success-strong text-sm font-medium flex items-center justify-center mb-1">64</dt>
1214
+ <dd class="text-fg-success-strong text-sm font-medium">Done</dd>
1215
+ </dl>
1216
+ </div>
1217
+ <button data-collapse-toggle="more-details" type="button" class="hover:underline text-sm text-body font-medium inline-flex items-center">
1218
+ Show more details
1219
+ <svg class="w-4 h-4 ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
1220
+ </button>
1221
+ <div id="more-details" class="border-light border-t pt-3 mt-3 space-y-2 hidden">
1222
+ <dl class="flex items-center justify-between">
1223
+ <dt class="text-body text-sm font-normal">Average task completion rate:</dt>
1224
+ <dd class="inline-flex items-center bg-success-soft border border-success-subtle text-fg-success-strong text-xs font-medium px-1.5 py-0.5 rounded">
1225
+ <svg class="w-4 h-4 me-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v13m0-13 4 4m-4-4-4 4"/></svg>
1226
+ 57%
1227
+ </dd>
1228
+ </dl>
1229
+ <dl class="flex items-center justify-between">
1230
+ <dt class="text-body text-sm font-normal">Days until sprint ends:</dt>
1231
+ <dd class="inline-flex items-center bg-neutral-primary-medium border border-default-medium text-heading text-xs font-medium px-1.5 py-0.5 rounded">13 days</dd>
1232
+ </dl>
1233
+ <dl class="flex items-center justify-between">
1234
+ <dt class="text-body text-sm font-normal">Next meeting:</dt>
1235
+ <dd class="inline-flex items-center bg-neutral-primary-medium border border-default-medium text-heading text-xs font-medium px-1.5 py-0.5 rounded">
1236
+ <svg class="w-3.5 h-3.5 me-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10h16m-8-3V4M7 7V4m10 3V4M5 20h14a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Zm3-7h.01v.01H8V13Zm4 0h.01v.01H12V13Zm4 0h.01v.01H16V13Zm-8 4h.01v.01H8V17Zm4 0h.01v.01H12V17Zm4 0h.01v.01H16V17Z"/></svg>
1237
+ Thursday
1238
+ </dd>
1239
+ </dl>
1134
1240
  </div>
1135
1241
  </div>
1136
1242
 
1137
- <!-- Donut Chart -->
1138
- <div class="py-6" id="donut-chart"></div>
1243
+ <!-- Radial Chart -->
1244
+ <div class="py-6" id="radial-chart"></div>
1139
1245
 
1140
1246
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
1141
1247
  <div class="flex justify-between items-center pt-4 md:pt-6">
1142
1248
  <!-- Button -->
1143
- <button id="dropdownLastDays5Button" data-dropdown-toggle="LastDays5dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1249
+ <button id="dropdownLastDays6Button" data-dropdown-toggle="LastDays6dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1144
1250
  Last 7 days
1145
1251
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
1146
1252
  </button>
1147
1253
  <!-- Dropdown menu -->
1148
- <div id="LastDays5dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1149
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays5Button">
1254
+ <div id="LastDays6dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1255
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays6Button">
1150
1256
  <li>
1151
1257
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
1152
1258
  </li>
@@ -1165,20 +1271,16 @@ In this example we also show how you can set event listeners on the UI component
1165
1271
  </ul>
1166
1272
  </div>
1167
1273
  <a href="#" class="inline-flex items-center text-fg-brand bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
1168
- Traffic analysis
1274
+ Progress report
1169
1275
  <svg class="w-4 h-4 ms-1.5 -me-0.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
1170
1276
  </a>
1171
1277
  </div>
1172
1278
  </div>
1173
1279
  </div>
1174
- {{< /example >}}
1175
-
1176
- ## Radial chart
1177
-
1178
- To create a radial chart with multiple data entries you need to set the `type: "radialBar"` when initialising a new chart and introduce multiple series and labels to the options and copy the following code:
1280
+ ```
1179
1281
 
1180
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
1181
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1282
+ ```javascript
1283
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1182
1284
  const getBrandColor = () => {
1183
1285
  // Get the computed style of the document's root element
1184
1286
  const computedStyle = getComputedStyle(document.documentElement);
@@ -1266,88 +1368,43 @@ To create a radial chart with multiple data entries you need to set the `type: "
1266
1368
  }
1267
1369
  }
1268
1370
 
1269
- if (document.getElementById("radial-chart") && typeof ApexCharts !== 'undefined') {
1270
- const chart = new ApexCharts(document.querySelector("#radial-chart"), getChartOptions());
1271
- chart.render();
1272
- }
1273
- ` >}}
1274
- <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
1275
- <div class="flex justify-between mb-4 md:mb-6">
1276
- <div class="flex items-center">
1277
- <div class="flex justify-center items-center">
1278
- <h5 class="text-xl font-semibold text-heading me-1">Your team's progress</h5>
1279
- <svg data-popover-target="team-progress-2" data-popover-placement="bottom" class="w-4 h-4 text-body hover:text-heading cursor-pointer ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
1280
- <div data-popover id="team-progress-2" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
1281
- <div>
1282
- <h3 class="font-semibold text-heading mb-2">Activity growth - Incremental</h3>
1283
- <p class="mb-4">Report helps navigate cumulative growth of community activities. Ideally, the chart should have a growing trend, as stagnating chart signifies a significant decrease of community activity.</p>
1284
- <h3 class="font-semibold text-heading mb-2">Calculation</h3>
1285
- <p class="mb-4">For each date bucket, the all-time volume of activities is calculated. This means that activities in period n contain all activities up to period n, plus the activities generated by your community in period.</p>
1286
- <a href="#" class="flex items-center font-medium text-fg-brand hover:underline">
1287
- Read more
1288
- <svg class="w-4 h-4 ms-1 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
1289
- </a>
1290
- </div>
1291
- <div data-popper-arrow></div>
1292
- </div>
1293
- </div>
1294
- </div>
1295
- </div>
1296
-
1297
- <div class="bg-neutral-secondary-medium border border-light-medium p-3 rounded-base">
1298
- <div class="grid grid-cols-3 gap-3 mb-3">
1299
- <dl class="bg-brand-softer border border-brand-subtle text-fg-brand-strong rounded-base flex flex-col items-center justify-center h-[78px]">
1300
- <dt class="w-8 h-8 rounded-full bg-brand-soft text-fg-brand-strong text-sm font-medium flex items-center justify-center mb-1">12</dt>
1301
- <dd class="text-fg-brand text-sm font-medium">To do</dd>
1302
- </dl>
1303
- <dl class="bg-warning-soft border border-warning-subtle text-fg-warning rounded-base flex flex-col items-center justify-center h-[78px]">
1304
- <dt class="w-8 h-8 rounded-full bg-warning-medium text-fg-warning text-sm font-medium flex items-center justify-center mb-1">23</dt>
1305
- <dd class="text-fg-warning text-sm font-medium">In progress</dd>
1306
- </dl>
1307
- <dl class="bg-success-soft border border-success-subtle text-fg-success-strong rounded-base flex flex-col items-center justify-center h-[78px]">
1308
- <dt class="w-8 h-8 rounded-full bg-success-medium text-fg-success-strong text-sm font-medium flex items-center justify-center mb-1">64</dt>
1309
- <dd class="text-fg-success-strong text-sm font-medium">Done</dd>
1310
- </dl>
1371
+ if (document.getElementById("radial-chart") && typeof ApexCharts !== 'undefined') {
1372
+ const chart = new ApexCharts(document.querySelector("#radial-chart"), getChartOptions());
1373
+ chart.render();
1374
+ }
1375
+ ```
1376
+
1377
+ ## Options
1378
+
1379
+ Learn more about how you can customize the charts including the data, labels, legend indicators, size and appearance of the graphs, and other options by checking out the examples below.
1380
+
1381
+ ### Data series
1382
+
1383
+ You can add multiple data sets by using the `series` object and setting a name, array of data and custom color of choice. In this example we added two data series based on a blue and purple color.
1384
+
1385
+ ```html
1386
+ <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
1387
+ <div class="flex justify-between">
1388
+ <div>
1389
+ <h5 class="text-2xl font-bold text-heading">$12,423</h5>
1390
+ <p class="text-body">Sales this week</p>
1311
1391
  </div>
1312
- <button data-collapse-toggle="more-details" type="button" class="hover:underline text-sm text-body font-medium inline-flex items-center">
1313
- Show more details
1314
- <svg class="w-4 h-4 ms-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
1315
- </button>
1316
- <div id="more-details" class="border-light border-t pt-3 mt-3 space-y-2 hidden">
1317
- <dl class="flex items-center justify-between">
1318
- <dt class="text-body text-sm font-normal">Average task completion rate:</dt>
1319
- <dd class="inline-flex items-center bg-success-soft border border-success-subtle text-fg-success-strong text-xs font-medium px-1.5 py-0.5 rounded">
1320
- <svg class="w-4 h-4 me-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v13m0-13 4 4m-4-4-4 4"/></svg>
1321
- 57%
1322
- </dd>
1323
- </dl>
1324
- <dl class="flex items-center justify-between">
1325
- <dt class="text-body text-sm font-normal">Days until sprint ends:</dt>
1326
- <dd class="inline-flex items-center bg-neutral-primary-medium border border-default-medium text-heading text-xs font-medium px-1.5 py-0.5 rounded">13 days</dd>
1327
- </dl>
1328
- <dl class="flex items-center justify-between">
1329
- <dt class="text-body text-sm font-normal">Next meeting:</dt>
1330
- <dd class="inline-flex items-center bg-neutral-primary-medium border border-default-medium text-heading text-xs font-medium px-1.5 py-0.5 rounded">
1331
- <svg class="w-3.5 h-3.5 me-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10h16m-8-3V4M7 7V4m10 3V4M5 20h14a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1Zm3-7h.01v.01H8V13Zm4 0h.01v.01H12V13Zm4 0h.01v.01H16V13Zm-8 4h.01v.01H8V17Zm4 0h.01v.01H12V17Zm4 0h.01v.01H16V17Z"/></svg>
1332
- Thursday
1333
- </dd>
1334
- </dl>
1392
+ <div class="flex items-center px-2.5 py-0.5 font-medium text-fg-success text-center">
1393
+ <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v13m0-13 4 4m-4-4-4 4"/></svg>
1394
+ 12%
1335
1395
  </div>
1336
1396
  </div>
1337
-
1338
- <!-- Radial Chart -->
1339
- <div class="py-6" id="radial-chart"></div>
1340
-
1397
+ <div id="data-series-chart"></div>
1341
1398
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
1342
1399
  <div class="flex justify-between items-center pt-4 md:pt-6">
1343
1400
  <!-- Button -->
1344
- <button id="dropdownLastDays6Button" data-dropdown-toggle="LastDays6dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1401
+ <button id="dropdownLastDays8Button" data-dropdown-toggle="LastDays8dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1345
1402
  Last 7 days
1346
1403
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
1347
1404
  </button>
1348
1405
  <!-- Dropdown menu -->
1349
- <div id="LastDays6dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1350
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays6Button">
1406
+ <div id="LastDays8dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1407
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays8Button">
1351
1408
  <li>
1352
1409
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
1353
1410
  </li>
@@ -1372,18 +1429,10 @@ To create a radial chart with multiple data entries you need to set the `type: "
1372
1429
  </div>
1373
1430
  </div>
1374
1431
  </div>
1375
- {{< /example >}}
1376
-
1377
- ## Options
1378
-
1379
- Learn more about how you can customize the charts including the data, labels, legend indicators, size and appearance of the graphs, and other options by checking out the examples below.
1380
-
1381
- ### Data series
1382
-
1383
- You can add multiple data sets by using the `series` object and setting a name, array of data and custom color of choice. In this example we added two data series based on a blue and purple color.
1432
+ ```
1384
1433
 
1385
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
1386
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1434
+ ```javascript
1435
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1387
1436
  const getBrandColor = () => {
1388
1437
  // Get the computed style of the document's root element
1389
1438
  const computedStyle = getComputedStyle(document.documentElement);
@@ -1485,7 +1534,13 @@ You can add multiple data sets by using the `series` object and setting a name,
1485
1534
  const chart = new ApexCharts(document.getElementById("data-series-chart"), options);
1486
1535
  chart.render();
1487
1536
  }
1488
- ` >}}
1537
+ ```
1538
+
1539
+ ### Labels
1540
+
1541
+ Show labels for the X and Y axis by enabling the `xaxis: {show: true}` and `yaxis: {show: true}` and customize the appearance of the labels by adding Tailwind CSS utility classes to the `cssClass` object based on the following example:
1542
+
1543
+ ```html
1489
1544
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
1490
1545
  <div class="flex justify-between">
1491
1546
  <div>
@@ -1497,17 +1552,17 @@ You can add multiple data sets by using the `series` object and setting a name,
1497
1552
  12%
1498
1553
  </div>
1499
1554
  </div>
1500
- <div id="data-series-chart"></div>
1555
+ <div id="labels-chart" class="py-4 md:py-6"></div>
1501
1556
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
1502
1557
  <div class="flex justify-between items-center pt-4 md:pt-6">
1503
1558
  <!-- Button -->
1504
- <button id="dropdownLastDays8Button" data-dropdown-toggle="LastDays8dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1559
+ <button id="dropdownLastDays9Button" data-dropdown-toggle="LastDays9dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1505
1560
  Last 7 days
1506
1561
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
1507
1562
  </button>
1508
1563
  <!-- Dropdown menu -->
1509
- <div id="LastDays8dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1510
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays8Button">
1564
+ <div id="LastDays9dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1565
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays9Button">
1511
1566
  <li>
1512
1567
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
1513
1568
  </li>
@@ -1532,14 +1587,10 @@ You can add multiple data sets by using the `series` object and setting a name,
1532
1587
  </div>
1533
1588
  </div>
1534
1589
  </div>
1535
- {{< /example >}}
1536
-
1537
- ### Labels
1538
-
1539
- Show labels for the X and Y axis by enabling the `xaxis: {show: true}` and `yaxis: {show: true}` and customize the appearance of the labels by adding Tailwind CSS utility classes to the `cssClass` object based on the following example:
1590
+ ```
1540
1591
 
1541
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
1542
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1592
+ ```javascript
1593
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1543
1594
  const getBrandColor = () => {
1544
1595
  // Get the computed style of the document's root element
1545
1596
  const computedStyle = getComputedStyle(document.documentElement);
@@ -1648,7 +1699,13 @@ Show labels for the X and Y axis by enabling the `xaxis: {show: true}` and `yaxi
1648
1699
  const chart = new ApexCharts(document.getElementById("labels-chart"), options);
1649
1700
  chart.render();
1650
1701
  }
1651
- ` >}}
1702
+ ```
1703
+
1704
+ ### Legends
1705
+
1706
+ Automatically show the legend indicators of the chart by setting the `legend: { show: true }` value when configuring the options via JavaScript. You can also set position of the legend by using the `position: {x}` option inside the legend object to place it to the top or bottom side of the chart.
1707
+
1708
+ ```html
1652
1709
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
1653
1710
  <div class="flex justify-between">
1654
1711
  <div>
@@ -1660,17 +1717,17 @@ Show labels for the X and Y axis by enabling the `xaxis: {show: true}` and `yaxi
1660
1717
  12%
1661
1718
  </div>
1662
1719
  </div>
1663
- <div id="labels-chart" class="py-4 md:py-6"></div>
1720
+ <div id="legend-chart" class="py-4 md:py-6"></div>
1664
1721
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
1665
1722
  <div class="flex justify-between items-center pt-4 md:pt-6">
1666
1723
  <!-- Button -->
1667
- <button id="dropdownLastDays9Button" data-dropdown-toggle="LastDays9dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1724
+ <button id="dropdownLastDays10Button" data-dropdown-toggle="LastDays10dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1668
1725
  Last 7 days
1669
1726
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
1670
1727
  </button>
1671
1728
  <!-- Dropdown menu -->
1672
- <div id="LastDays9dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1673
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays9Button">
1729
+ <div id="LastDays10dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1730
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays10Button">
1674
1731
  <li>
1675
1732
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
1676
1733
  </li>
@@ -1695,14 +1752,10 @@ Show labels for the X and Y axis by enabling the `xaxis: {show: true}` and `yaxi
1695
1752
  </div>
1696
1753
  </div>
1697
1754
  </div>
1698
- {{< /example >}}
1699
-
1700
- ### Legends
1701
-
1702
- Automatically show the legend indicators of the chart by setting the `legend: { show: true }` value when configuring the options via JavaScript. You can also set position of the legend by using the `position: {x}` option inside the legend object to place it to the top or bottom side of the chart.
1755
+ ```
1703
1756
 
1704
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
1705
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1757
+ ```javascript
1758
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1706
1759
  const getBrandColor = () => {
1707
1760
  // Get the computed style of the document's root element
1708
1761
  const computedStyle = getComputedStyle(document.documentElement);
@@ -1804,7 +1857,16 @@ Automatically show the legend indicators of the chart by setting the `legend: {
1804
1857
  const chart = new ApexCharts(document.getElementById("legend-chart"), options);
1805
1858
  chart.render();
1806
1859
  }
1807
- ` >}}
1860
+ ```
1861
+
1862
+ ### Tooltip
1863
+
1864
+ Enable the tooltip that is shown when hovering over a data set by setting `{tooltip: {enabled: true}}` and customize the tooltip component via the following options:
1865
+
1866
+ - `x: {show: false}` will show or hide the X axis data
1867
+ - `y: {show: true}` will show or hide the Y axis data
1868
+
1869
+ ```html
1808
1870
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
1809
1871
  <div class="flex justify-between">
1810
1872
  <div>
@@ -1816,17 +1878,17 @@ Automatically show the legend indicators of the chart by setting the `legend: {
1816
1878
  12%
1817
1879
  </div>
1818
1880
  </div>
1819
- <div id="legend-chart" class="py-4 md:py-6"></div>
1881
+ <div id="tooltip-chart" class="py-4 md:py-6"></div>
1820
1882
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
1821
1883
  <div class="flex justify-between items-center pt-4 md:pt-6">
1822
1884
  <!-- Button -->
1823
- <button id="dropdownLastDays10Button" data-dropdown-toggle="LastDays10dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1885
+ <button id="dropdownLastDays11Button" data-dropdown-toggle="LastDays11dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1824
1886
  Last 7 days
1825
1887
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
1826
1888
  </button>
1827
1889
  <!-- Dropdown menu -->
1828
- <div id="LastDays10dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1829
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays10Button">
1890
+ <div id="LastDays11dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1891
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays11Button">
1830
1892
  <li>
1831
1893
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
1832
1894
  </li>
@@ -1851,17 +1913,10 @@ Automatically show the legend indicators of the chart by setting the `legend: {
1851
1913
  </div>
1852
1914
  </div>
1853
1915
  </div>
1854
- {{< /example >}}
1855
-
1856
- ### Tooltip
1857
-
1858
- Enable the tooltip that is shown when hovering over a data set by setting `{tooltip: {enabled: true}}` and customize the tooltip component via the following options:
1859
-
1860
- - `x: {show: false}` will show or hide the X axis data
1861
- - `y: {show: true}` will show or hide the Y axis data
1916
+ ```
1862
1917
 
1863
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
1864
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1918
+ ```javascript
1919
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
1865
1920
  const getBrandColor = () => {
1866
1921
  // Get the computed style of the document's root element
1867
1922
  const computedStyle = getComputedStyle(document.documentElement);
@@ -1966,7 +2021,13 @@ Enable the tooltip that is shown when hovering over a data set by setting `{tool
1966
2021
  const chart = new ApexCharts(document.getElementById("tooltip-chart"), options);
1967
2022
  chart.render();
1968
2023
  }
1969
- ` >}}
2024
+ ```
2025
+
2026
+ ### Grid
2027
+
2028
+ Add a grid layout of dashed lines to improve the readability of the data entries for the charts by configuring the `{grid: { show: true }}` object and customize the appearance via the `strokeDashArray` object.
2029
+
2030
+ ```html
1970
2031
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
1971
2032
  <div class="flex justify-between">
1972
2033
  <div>
@@ -1978,17 +2039,17 @@ Enable the tooltip that is shown when hovering over a data set by setting `{tool
1978
2039
  12%
1979
2040
  </div>
1980
2041
  </div>
1981
- <div id="tooltip-chart" class="py-4 md:py-6"></div>
2042
+ <div id="grid-chart" class="py-4 md:py-6"></div>
1982
2043
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
1983
2044
  <div class="flex justify-between items-center pt-4 md:pt-6">
1984
2045
  <!-- Button -->
1985
- <button id="dropdownLastDays11Button" data-dropdown-toggle="LastDays11dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
2046
+ <button id="dropdownLastDays12Button" data-dropdown-toggle="LastDays12dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
1986
2047
  Last 7 days
1987
2048
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
1988
2049
  </button>
1989
2050
  <!-- Dropdown menu -->
1990
- <div id="LastDays11dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
1991
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays11Button">
2051
+ <div id="LastDays12dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
2052
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays12Button">
1992
2053
  <li>
1993
2054
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
1994
2055
  </li>
@@ -2013,14 +2074,10 @@ Enable the tooltip that is shown when hovering over a data set by setting `{tool
2013
2074
  </div>
2014
2075
  </div>
2015
2076
  </div>
2016
- {{< /example >}}
2017
-
2018
- ### Grid
2019
-
2020
- Add a grid layout of dashed lines to improve the readability of the data entries for the charts by configuring the `{grid: { show: true }}` object and customize the appearance via the `strokeDashArray` object.
2077
+ ```
2021
2078
 
2022
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
2023
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
2079
+ ```javascript
2080
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
2024
2081
  const getBrandColor = () => {
2025
2082
  // Get the computed style of the document's root element
2026
2083
  const computedStyle = getComputedStyle(document.documentElement);
@@ -2122,7 +2179,13 @@ Add a grid layout of dashed lines to improve the readability of the data entries
2122
2179
  const chart = new ApexCharts(document.getElementById("grid-chart"), options);
2123
2180
  chart.render();
2124
2181
  }
2125
- ` >}}
2182
+ ```
2183
+
2184
+ ### Data labels
2185
+
2186
+ Show data points on the chart by enable the `dataLabels: {enabled: true}` object when configuring the options via JavaScript and customize the appearance based on the following example:
2187
+
2188
+ ```html
2126
2189
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
2127
2190
  <div class="flex justify-between">
2128
2191
  <div>
@@ -2134,17 +2197,17 @@ Add a grid layout of dashed lines to improve the readability of the data entries
2134
2197
  12%
2135
2198
  </div>
2136
2199
  </div>
2137
- <div id="grid-chart" class="py-4 md:py-6"></div>
2200
+ <div id="data-labels-chart" class="py-4 md:py-6"></div>
2138
2201
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
2139
2202
  <div class="flex justify-between items-center pt-4 md:pt-6">
2140
2203
  <!-- Button -->
2141
- <button id="dropdownLastDays12Button" data-dropdown-toggle="LastDays12dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
2204
+ <button id="dropdownLastDays13Button" data-dropdown-toggle="LastDays13dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
2142
2205
  Last 7 days
2143
2206
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
2144
2207
  </button>
2145
2208
  <!-- Dropdown menu -->
2146
- <div id="LastDays12dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
2147
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays12Button">
2209
+ <div id="LastDays13dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
2210
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays13Button">
2148
2211
  <li>
2149
2212
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
2150
2213
  </li>
@@ -2169,14 +2232,10 @@ Add a grid layout of dashed lines to improve the readability of the data entries
2169
2232
  </div>
2170
2233
  </div>
2171
2234
  </div>
2172
- {{< /example >}}
2173
-
2174
- ### Data labels
2175
-
2176
- Show data points on the chart by enable the `dataLabels: {enabled: true}` object when configuring the options via JavaScript and customize the appearance based on the following example:
2235
+ ```
2177
2236
 
2178
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
2179
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
2237
+ ```javascript
2238
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
2180
2239
  const getBrandColor = () => {
2181
2240
  // Get the computed style of the document's root element
2182
2241
  const computedStyle = getComputedStyle(document.documentElement);
@@ -2282,7 +2341,13 @@ Show data points on the chart by enable the `dataLabels: {enabled: true}` object
2282
2341
  const chart = new ApexCharts(document.getElementById("data-labels-chart"), options);
2283
2342
  chart.render();
2284
2343
  }
2285
- ` >}}
2344
+ ```
2345
+
2346
+ ### Format data
2347
+
2348
+ If you want to format and prefix your data with something such as a currency sign you can do that by using the `formatter` function. For example, here we use the euro ("€") sign instead of the dollar ("$").
2349
+
2350
+ ```html
2286
2351
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
2287
2352
  <div class="flex justify-between">
2288
2353
  <div>
@@ -2294,17 +2359,17 @@ Show data points on the chart by enable the `dataLabels: {enabled: true}` object
2294
2359
  12%
2295
2360
  </div>
2296
2361
  </div>
2297
- <div id="data-labels-chart" class="py-4 md:py-6"></div>
2362
+ <div id="main-chart" class="py-4 md:py-6"></div>
2298
2363
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
2299
2364
  <div class="flex justify-between items-center pt-4 md:pt-6">
2300
2365
  <!-- Button -->
2301
- <button id="dropdownLastDays13Button" data-dropdown-toggle="LastDays13dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
2366
+ <button id="dropdownLastDays14Button" data-dropdown-toggle="LastDays14dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
2302
2367
  Last 7 days
2303
2368
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
2304
2369
  </button>
2305
2370
  <!-- Dropdown menu -->
2306
- <div id="LastDays13dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
2307
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays13Button">
2371
+ <div id="LastDays14dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
2372
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays14Button">
2308
2373
  <li>
2309
2374
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
2310
2375
  </li>
@@ -2329,14 +2394,10 @@ Show data points on the chart by enable the `dataLabels: {enabled: true}` object
2329
2394
  </div>
2330
2395
  </div>
2331
2396
  </div>
2332
- {{< /example >}}
2333
-
2334
- ### Format data
2335
-
2336
- If you want to format and prefix your data with something such as a currency sign you can do that by using the `formatter` function. For example, here we use the euro ("€") sign instead of the dollar ("$").
2397
+ ```
2337
2398
 
2338
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
2339
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
2399
+ ```javascript
2400
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
2340
2401
  const getBrandColor = () => {
2341
2402
  // Get the computed style of the document's root element
2342
2403
  const computedStyle = getComputedStyle(document.documentElement);
@@ -2435,7 +2496,13 @@ If you want to format and prefix your data with something such as a currency sig
2435
2496
  const chart = new ApexCharts(document.getElementById("main-chart"), options);
2436
2497
  chart.render();
2437
2498
  }
2438
- ` >}}
2499
+ ```
2500
+
2501
+ ### Chart size
2502
+
2503
+ You can set the size (width and height) of the chart by passing the `width: {size}` and `height: {size}` options via JavaScript to the chart object using pixels or percentages:
2504
+
2505
+ ```html
2439
2506
  <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
2440
2507
  <div class="flex justify-between">
2441
2508
  <div>
@@ -2447,17 +2514,17 @@ If you want to format and prefix your data with something such as a currency sig
2447
2514
  12%
2448
2515
  </div>
2449
2516
  </div>
2450
- <div id="main-chart" class="py-4 md:py-6"></div>
2517
+ <div id="size-chart" class="[&>div]:mx-auto py-4 md:py-6"></div>
2451
2518
  <div class="grid grid-cols-1 items-center border-light border-t justify-between">
2452
2519
  <div class="flex justify-between items-center pt-4 md:pt-6">
2453
2520
  <!-- Button -->
2454
- <button id="dropdownLastDays14Button" data-dropdown-toggle="LastDays14dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
2521
+ <button id="dropdownLastDays15Button" data-dropdown-toggle="LastDays15dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
2455
2522
  Last 7 days
2456
2523
  <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
2457
2524
  </button>
2458
2525
  <!-- Dropdown menu -->
2459
- <div id="LastDays14dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
2460
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays14Button">
2526
+ <div id="LastDays15dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
2527
+ <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays15Button">
2461
2528
  <li>
2462
2529
  <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
2463
2530
  </li>
@@ -2482,14 +2549,10 @@ If you want to format and prefix your data with something such as a currency sig
2482
2549
  </div>
2483
2550
  </div>
2484
2551
  </div>
2485
- {{< /example >}}
2486
-
2487
- ### Chart size
2488
-
2489
- You can set the size (width and height) of the chart by passing the `width: {size}` and `height: {size}` options via JavaScript to the chart object using pixels or percentages:
2552
+ ```
2490
2553
 
2491
- {{< example class="flex justify-center bg-neutral-primary" github="plugins/charts.md" show_dark=true charts=true loadJavascriptListener=true disable_init_js=true javascript=`
2492
- // Get the CSS variable --color-brand and convert it to hex for ApexCharts
2554
+ ```javascript
2555
+ // Get the CSS variable --color-brand and convert it to hex for ApexCharts
2493
2556
  const getBrandColor = () => {
2494
2557
  // Get the computed style of the document's root element
2495
2558
  const computedStyle = getComputedStyle(document.documentElement);
@@ -2588,54 +2651,7 @@ You can set the size (width and height) of the chart by passing the `width: {siz
2588
2651
  const chart = new ApexCharts(document.getElementById("size-chart"), options);
2589
2652
  chart.render();
2590
2653
  }
2591
- ` >}}
2592
- <div class="max-w-sm w-full bg-neutral-primary-soft border border-default rounded-base shadow-xs p-4 md:p-6">
2593
- <div class="flex justify-between">
2594
- <div>
2595
- <h5 class="text-2xl font-bold text-heading">$12,423</h5>
2596
- <p class="text-body">Sales this week</p>
2597
- </div>
2598
- <div class="flex items-center px-2.5 py-0.5 font-medium text-fg-success text-center">
2599
- <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v13m0-13 4 4m-4-4-4 4"/></svg>
2600
- 12%
2601
- </div>
2602
- </div>
2603
- <div id="size-chart" class="[&>div]:mx-auto py-4 md:py-6"></div>
2604
- <div class="grid grid-cols-1 items-center border-light border-t justify-between">
2605
- <div class="flex justify-between items-center pt-4 md:pt-6">
2606
- <!-- Button -->
2607
- <button id="dropdownLastDays15Button" data-dropdown-toggle="LastDays15dropdown" data-dropdown-placement="bottom" class="text-sm font-medium text-body hover:text-heading text-center inline-flex items-center" type="button">
2608
- Last 7 days
2609
- <svg class="w-4 h-4 ms-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>
2610
- </button>
2611
- <!-- Dropdown menu -->
2612
- <div id="LastDays15dropdown" class="z-10 hidden bg-neutral-primary-medium border border-default-medium rounded-base shadow-lg w-44">
2613
- <ul class="p-2 text-sm text-body font-medium" aria-labelledby="dropdownLastDays15Button">
2614
- <li>
2615
- <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Yesterday</a>
2616
- </li>
2617
- <li>
2618
- <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Today</a>
2619
- </li>
2620
- <li>
2621
- <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Last 7 days</a>
2622
- </li>
2623
- <li>
2624
- <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Last 30 days</a>
2625
- </li>
2626
- <li>
2627
- <a href="#" class="inline-flex items-center w-full p-2 hover:bg-neutral-tertiary-medium hover:text-heading rounded">Last 90 days</a>
2628
- </li>
2629
- </ul>
2630
- </div>
2631
- <a href="#" class="inline-flex items-center text-fg-brand bg-transparent box-border border border-transparent hover:bg-neutral-secondary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
2632
- Progress report
2633
- <svg class="w-4 h-4 ms-1.5 -me-0.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
2634
- </a>
2635
- </div>
2636
- </div>
2637
- </div>
2638
- {{< /example >}}
2654
+ ```
2639
2655
 
2640
2656
  ## JavaScript behaviour
2641
2657
 
@@ -2643,24 +2659,24 @@ With the charts from Flowbite and through the API of ApexCharts you can programm
2643
2659
 
2644
2660
  For example, here's how you can initialize a new chart with an options object and call the `render()` function:
2645
2661
 
2646
- {{< code lang="javascript" file="charts.js" icon="file" >}}
2662
+ ```javascript
2647
2663
  const chart = new ApexCharts(el, options);
2648
2664
  chart.render();
2649
- {{< /code >}}
2665
+ ```
2650
2666
 
2651
2667
  You can also update the options or data on demand. Here's an example how you can add or remove data:
2652
2668
 
2653
- {{< code lang="javascript" file="charts.js" icon="file" >}}
2669
+ ```javascript
2654
2670
  const chart = new ApexCharts(el, options);
2655
2671
 
2656
2672
  chart.updateSeries([{
2657
2673
  data: [342, 442, 311, 421, 212]
2658
2674
  }]);
2659
- {{< /code >}}
2675
+ ```
2660
2676
 
2661
2677
  You can also toggle the visibility of a data series by calling the `toggleSeries()` method:
2662
2678
 
2663
- {{< code lang="javascript" file="charts.js" icon="file" >}}
2679
+ ```javascript
2664
2680
  const chart = new ApexCharts(el, {
2665
2681
  series: [{
2666
2682
  name: 'Developer Edition'
@@ -2672,7 +2688,7 @@ const chart = new ApexCharts(el, {
2672
2688
  });
2673
2689
 
2674
2690
  chart.toggleSeries('Designer Edition');
2675
- {{< /code >}}
2691
+ ```
2676
2692
 
2677
2693
  You can read more about all of the methods by checking out the official <a href="https://apexcharts.com/docs/methods/#render" rel="nofollow">ApexCharts documentation</a>.
2678
2694