@kubex/zinc 1.0.25 → 1.0.99

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 (199) hide show
  1. package/.claude/project.md +556 -0
  2. package/.github/workflows/js_build_and_deploy.yaml +9 -10
  3. package/dist/custom-elements.json +13575 -8856
  4. package/dist/vscode.html-custom-data.json +583 -48
  5. package/dist/web-types.json +1441 -181
  6. package/dist/zn.d.ts +1645 -660
  7. package/dist/zn.min.css +1 -1
  8. package/dist/zn.min.js +1412 -893
  9. package/docs/_utilities/code-previews.cjs +10 -1
  10. package/docs/assets/scripts/docs.js +42 -18
  11. package/docs/data/data-table.json +229 -66
  12. package/docs/data/empty.json +6 -0
  13. package/docs/data/products-table.json +41 -193
  14. package/docs/pages/components/action-bar.md +121 -6
  15. package/docs/pages/components/alert.md +118 -15
  16. package/docs/pages/components/animated-button.md +299 -0
  17. package/docs/pages/components/audio-select.md +534 -0
  18. package/docs/pages/components/bulk-actions.md +79 -5
  19. package/docs/pages/components/button-group.md +235 -27
  20. package/docs/pages/components/button.md +139 -1
  21. package/docs/pages/components/chart.md +365 -9
  22. package/docs/pages/components/checkbox.md +387 -58
  23. package/docs/pages/components/chip.md +253 -33
  24. package/docs/pages/components/collapsible.md +393 -46
  25. package/docs/pages/components/cols.md +152 -30
  26. package/docs/pages/components/confirm.md +182 -16
  27. package/docs/pages/components/copy-button.md +169 -6
  28. package/docs/pages/components/data-select.md +194 -15
  29. package/docs/pages/components/data-table-filter.md +96 -5
  30. package/docs/pages/components/data-table-search.md +451 -0
  31. package/docs/pages/components/data-table-sort.md +66 -5
  32. package/docs/pages/components/data-table.md +727 -66
  33. package/docs/pages/components/datepicker.md +402 -7
  34. package/docs/pages/components/defined-label.md +120 -5
  35. package/docs/pages/components/dialog.md +339 -59
  36. package/docs/pages/components/dropdown.md +366 -11
  37. package/docs/pages/components/editor.md +604 -7
  38. package/docs/pages/components/empty-state.md +315 -16
  39. package/docs/pages/components/expanding-action.md +212 -28
  40. package/docs/pages/components/file.md +421 -12
  41. package/docs/pages/components/filter-container.md +158 -5
  42. package/docs/pages/components/filter-wrapper.md +167 -6
  43. package/docs/pages/components/form-group.md +383 -6
  44. package/docs/pages/components/hover-container.md +237 -6
  45. package/docs/pages/components/icon-picker.md +121 -0
  46. package/docs/pages/components/icon.md +454 -48
  47. package/docs/pages/components/inline-edit.md +787 -19
  48. package/docs/pages/components/input-group.md +207 -13
  49. package/docs/pages/components/input.md +194 -0
  50. package/docs/pages/components/item.md +18 -0
  51. package/docs/pages/components/key-container.md +115 -0
  52. package/docs/pages/components/key.md +101 -0
  53. package/docs/pages/components/menu.md +512 -6
  54. package/docs/pages/components/note.md +239 -36
  55. package/docs/pages/components/opt-group.md +107 -0
  56. package/docs/pages/components/pagination.md +332 -6
  57. package/docs/pages/components/pane.md +222 -6
  58. package/docs/pages/components/panel.md +213 -26
  59. package/docs/pages/components/popup.md +1354 -6
  60. package/docs/pages/components/priority-list.md +233 -0
  61. package/docs/pages/components/progress-bar.md +387 -6
  62. package/docs/pages/components/radio-group.md +242 -5
  63. package/docs/pages/components/radio.md +474 -6
  64. package/docs/pages/components/rating.md +331 -7
  65. package/docs/pages/components/reveal.md +524 -6
  66. package/docs/pages/components/scroll-container.md +552 -6
  67. package/docs/pages/components/select.md +762 -160
  68. package/docs/pages/components/skeleton.md +473 -30
  69. package/docs/pages/components/slideout.md +261 -5
  70. package/docs/pages/components/sp.md +99 -41
  71. package/docs/pages/components/split-button.md +347 -9
  72. package/docs/pages/components/split-pane.md +445 -6
  73. package/docs/pages/components/stat.md +549 -9
  74. package/docs/pages/components/status-indicator.md +230 -1
  75. package/docs/pages/components/stepper.md +563 -6
  76. package/docs/pages/components/tabs.md +439 -13
  77. package/docs/pages/components/textarea.md +415 -17
  78. package/docs/pages/components/tile.md +385 -26
  79. package/docs/pages/components/toggle.md +424 -6
  80. package/docs/pages/components/tooltip.md +367 -0
  81. package/docs/pages/components/translation-group.md +210 -0
  82. package/docs/pages/components/translations.md +319 -19
  83. package/docs/pages/components/vertical-stepper.md +401 -8
  84. package/docs/pages/components/well.md +300 -3
  85. package/docs/pages/getting-started/form-controls.md +162 -0
  86. package/docs/pages/index.md +116 -15
  87. package/package.json +5 -6
  88. package/scss/_global-spacing.scss +4 -0
  89. package/scss/_root.scss +2 -2
  90. package/scss/boot.scss +19 -0
  91. package/scss/shared/layout.scss +5 -0
  92. package/scss/themes/_light.scss +3 -3
  93. package/src/components/alert/alert.scss +1 -0
  94. package/src/components/animated-button/README.md +306 -0
  95. package/src/components/animated-button/animated-button.component.ts +229 -0
  96. package/src/components/animated-button/animated-button.scss +228 -0
  97. package/src/components/animated-button/animated-button.test.ts +143 -0
  98. package/src/components/animated-button/index.ts +12 -0
  99. package/src/components/button/button.component.ts +5 -0
  100. package/src/components/button-group/button-group.component.ts +25 -13
  101. package/src/components/button-group/button-group.scss +6 -0
  102. package/src/components/checkbox/checkbox.component.ts +4 -0
  103. package/src/components/checkbox/checkbox.scss +7 -4
  104. package/src/components/checkbox-group/checkbox-group.scss +7 -0
  105. package/src/components/chip/chip.component.ts +7 -2
  106. package/src/components/chip/chip.scss +16 -2
  107. package/src/components/collapsible/collapsible.component.ts +27 -20
  108. package/src/components/cols/cols.component.ts +14 -2
  109. package/src/components/cols/cols.scss +6 -12
  110. package/src/components/confirm/confirm.component.ts +7 -0
  111. package/src/components/copy-button/copy-button.component.ts +12 -11
  112. package/src/components/data-select/data-select.component.ts +215 -44
  113. package/src/components/data-select/data-select.scss +66 -6
  114. package/src/components/data-select/providers/currency-data-provider.ts +20 -6
  115. package/src/components/data-select/providers/provider.ts +1 -0
  116. package/src/components/data-select/providers/us-state-data-provider.ts +68 -0
  117. package/src/components/data-table/data-table.component.ts +81 -22
  118. package/src/components/data-table-search/data-table-search.component.ts +184 -0
  119. package/src/components/data-table-search/data-table-search.scss +17 -0
  120. package/src/components/data-table-search/data-table-search.test.ts +11 -0
  121. package/src/components/data-table-search/index.ts +12 -0
  122. package/src/components/datepicker/datepicker.component.ts +347 -13
  123. package/src/components/dialog/dialog.component.ts +1 -1
  124. package/src/components/empty-state/empty-state.scss +6 -1
  125. package/src/components/header/header.scss +3 -3
  126. package/src/components/icon/icon.component.ts +23 -1
  127. package/src/components/icon/icon.scss +23 -0
  128. package/src/components/icon-picker/brand-icons.ts +24 -0
  129. package/src/components/icon-picker/icon-picker.component.ts +407 -0
  130. package/src/components/icon-picker/icon-picker.scss +205 -0
  131. package/src/components/icon-picker/index.ts +12 -0
  132. package/src/components/icon-picker/line-icons.ts +612 -0
  133. package/src/components/icon-picker/material-icons.ts +14543 -0
  134. package/src/components/inline-edit/inline-edit.component.ts +190 -46
  135. package/src/components/inline-edit/inline-edit.scss +29 -0
  136. package/src/components/inline-edit/inline-edit.test.ts +314 -1
  137. package/src/components/input/input.component.ts +324 -5
  138. package/src/components/input/input.scss +87 -0
  139. package/src/components/input-group/input-group.component.ts +28 -7
  140. package/src/components/input-group/input-group.scss +48 -10
  141. package/src/components/item/item.component.ts +24 -3
  142. package/src/components/item/item.scss +18 -0
  143. package/src/components/key/index.ts +12 -0
  144. package/src/components/key/key.component.ts +47 -0
  145. package/src/components/key/key.scss +38 -0
  146. package/src/components/key-container/index.ts +12 -0
  147. package/src/components/key-container/key-container.component.ts +142 -0
  148. package/src/components/key-container/key-container.scss +33 -0
  149. package/src/components/menu-item/menu-item.component.ts +20 -0
  150. package/src/components/menu-item/menu-item.scss +69 -2
  151. package/src/components/navbar/navbar.component.ts +103 -11
  152. package/src/components/navbar/navbar.scss +6 -1
  153. package/src/components/opt-group/index.ts +12 -0
  154. package/src/components/opt-group/opt-group.component.ts +74 -0
  155. package/src/components/opt-group/opt-group.scss +37 -0
  156. package/src/components/opt-group/opt-group.test.ts +27 -0
  157. package/src/components/option/option.component.ts +1 -16
  158. package/src/components/option/option.scss +4 -0
  159. package/src/components/panel/panel.component.ts +10 -8
  160. package/src/components/panel/panel.scss +20 -0
  161. package/src/components/priority-list/index.ts +12 -0
  162. package/src/components/priority-list/priority-list.component.ts +611 -0
  163. package/src/components/priority-list/priority-list.scss +185 -0
  164. package/src/components/priority-list/priority-list.test.ts +139 -0
  165. package/src/components/progress-bar/progress-bar.component.ts +22 -16
  166. package/src/components/radio/radio.scss +10 -3
  167. package/src/components/select/select.component.ts +812 -72
  168. package/src/components/select/select.scss +108 -2
  169. package/src/components/select/select.test.ts +147 -2
  170. package/src/components/settings-container/settings-container.component.ts +44 -19
  171. package/src/components/settings-container/settings-container.scss +1 -1
  172. package/src/components/skeleton/skeleton.component.ts +6 -1
  173. package/src/components/slideout/slideout.scss +8 -3
  174. package/src/components/sp/sp.component.ts +3 -1
  175. package/src/components/sp/sp.scss +19 -0
  176. package/src/components/stepper/stepper.component.ts +16 -10
  177. package/src/components/textarea/textarea.scss +0 -4
  178. package/src/components/tile/tile.component.ts +12 -3
  179. package/src/components/tile/tile.scss +1 -1
  180. package/src/components/timer/timer.component.ts +15 -2
  181. package/src/components/toggle/toggle.component.ts +29 -26
  182. package/src/components/toggle/toggle.scss +13 -1
  183. package/src/components/translation-group/index.ts +12 -0
  184. package/src/components/translation-group/translation-group.component.ts +207 -0
  185. package/src/components/translation-group/translation-group.scss +8 -0
  186. package/src/components/translations/translations.component.ts +90 -44
  187. package/src/components/translations/translations.scss +4 -0
  188. package/src/components/vertical-stepper/vertical-stepper.component.ts +14 -9
  189. package/src/events/events.ts +12 -7
  190. package/src/events/zn-language-change.ts +7 -0
  191. package/src/events/zn-purchase.ts +11 -0
  192. package/src/events/zn-redirect.ts +7 -0
  193. package/src/events/zn-reorder.ts +7 -0
  194. package/src/events/zn-search-change.ts +11 -0
  195. package/src/events/zn-submit.ts +1 -1
  196. package/src/form-control.scss +4 -0
  197. package/src/internal/form-navigation.ts +510 -0
  198. package/src/internal/form.ts +6 -0
  199. package/src/zinc.ts +91 -83
@@ -1,27 +1,383 @@
1
1
  ---
2
2
  meta:
3
3
  title: Data Chart
4
- description:
4
+ description: Charts visualize data using various chart types powered by ApexCharts. Display line charts, bar charts, area charts, and more with full customization options.
5
5
  layout: component
6
6
  ---
7
7
 
8
8
  ```html:preview
9
- <zn-chart
10
- type="area"
11
- categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;,&quot;Sep&quot;]"
12
- data="[{&quot;name&quot;:&quot;Series 1&quot;,&quot;data&quot;:[30,40,45,50,49,60,70,91,125]}]"
9
+ <zn-chart
10
+ type="area"
11
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;,&quot;Sep&quot;]"
12
+ data="[{&quot;name&quot;:&quot;Series 1&quot;,&quot;data&quot;:[30,40,45,50,49,60,70,91,125]}]"
13
13
  height="300">
14
14
  </zn-chart>
15
15
  ```
16
16
 
17
+ :::tip
18
+ The chart component is built on ApexCharts, providing a powerful and flexible charting library with extensive customization options. Visit the [ApexCharts documentation](https://apexcharts.com/docs/) for advanced configuration options.
19
+ :::
20
+
17
21
  ## Examples
18
22
 
19
- ### First Example
23
+ ### Basic Line Chart
24
+
25
+ Use `type="line"` to create a line chart. The `data` attribute accepts an array of series objects, and `categories` defines the x-axis labels.
26
+
27
+ ```html:preview
28
+ <zn-chart
29
+ type="line"
30
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;]"
31
+ data="[{&quot;name&quot;:&quot;Revenue&quot;,&quot;data&quot;:[30,40,35,50,49,60]},{&quot;name&quot;:&quot;Expenses&quot;,&quot;data&quot;:[20,29,25,35,39,45]}]"
32
+ height="300">
33
+ </zn-chart>
34
+ ```
35
+
36
+ ### Bar Chart
37
+
38
+ Use `type="bar"` to create a vertical bar chart. Perfect for comparing values across categories.
39
+
40
+ ```html:preview
41
+ <zn-chart
42
+ type="bar"
43
+ categories="[&quot;Q1&quot;,&quot;Q2&quot;,&quot;Q3&quot;,&quot;Q4&quot;]"
44
+ data="[{&quot;name&quot;:&quot;Sales&quot;,&quot;data&quot;:[44,55,57,56]},{&quot;name&quot;:&quot;Returns&quot;,&quot;data&quot;:[13,23,20,8]}]"
45
+ height="300">
46
+ </zn-chart>
47
+ ```
48
+
49
+ ### Area Chart
50
+
51
+ Use `type="area"` to create an area chart with filled regions under the line.
52
+
53
+ ```html:preview
54
+ <zn-chart
55
+ type="area"
56
+ categories="[&quot;Mon&quot;,&quot;Tue&quot;,&quot;Wed&quot;,&quot;Thu&quot;,&quot;Fri&quot;,&quot;Sat&quot;,&quot;Sun&quot;]"
57
+ data="[{&quot;name&quot;:&quot;Active Users&quot;,&quot;data&quot;:[150,200,180,220,240,280,260]}]"
58
+ height="300">
59
+ </zn-chart>
60
+ ```
61
+
62
+ ### Multiple Series
63
+
64
+ Charts support multiple data series. Each series appears with its own color and legend entry.
65
+
66
+ ```html:preview
67
+ <zn-chart
68
+ type="line"
69
+ categories="[&quot;Week 1&quot;,&quot;Week 2&quot;,&quot;Week 3&quot;,&quot;Week 4&quot;]"
70
+ data="[{&quot;name&quot;:&quot;Product A&quot;,&quot;data&quot;:[45,52,48,61]},{&quot;name&quot;:&quot;Product B&quot;,&quot;data&quot;:[35,41,36,46]},{&quot;name&quot;:&quot;Product C&quot;,&quot;data&quot;:[25,28,32,38]}]"
71
+ height="350">
72
+ </zn-chart>
73
+ ```
74
+
75
+ ### Stacked Bar Chart
76
+
77
+ Use the `stacked` attribute to create stacked bar charts where series are stacked on top of each other.
78
+
79
+ ```html:preview
80
+ <zn-chart
81
+ type="bar"
82
+ stacked
83
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;]"
84
+ data="[{&quot;name&quot;:&quot;Direct&quot;,&quot;data&quot;:[44,55,41,37,22]},{&quot;name&quot;:&quot;Referral&quot;,&quot;data&quot;:[53,32,33,52,13]},{&quot;name&quot;:&quot;Organic&quot;,&quot;data&quot;:[12,17,11,9,15]}]"
85
+ height="300">
86
+ </zn-chart>
87
+ ```
88
+
89
+ ### Stacked Area Chart
90
+
91
+ Stacked area charts work similarly to stacked bar charts but with area fills.
92
+
93
+ ```html:preview
94
+ <zn-chart
95
+ type="area"
96
+ stacked
97
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;]"
98
+ data="[{&quot;name&quot;:&quot;Desktop&quot;,&quot;data&quot;:[300,400,350,500,490,600]},{&quot;name&quot;:&quot;Mobile&quot;,&quot;data&quot;:[200,290,250,350,390,450]},{&quot;name&quot;:&quot;Tablet&quot;,&quot;data&quot;:[100,150,120,180,170,200]}]"
99
+ height="300">
100
+ </zn-chart>
101
+ ```
102
+
103
+ ### Chart Heights
104
+
105
+ Use the `height` attribute to control the chart's height in pixels. The default height is 300px.
106
+
107
+ ```html:preview
108
+ <zn-chart
109
+ type="bar"
110
+ categories="[&quot;Small&quot;,&quot;Medium&quot;,&quot;Large&quot;]"
111
+ data="[{&quot;name&quot;:&quot;Orders&quot;,&quot;data&quot;:[12,19,15]}]"
112
+ height="200">
113
+ </zn-chart>
114
+ <br />
115
+ <zn-chart
116
+ type="line"
117
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;]"
118
+ data="[{&quot;name&quot;:&quot;Sales&quot;,&quot;data&quot;:[40,55,45,60]}]"
119
+ height="400">
120
+ </zn-chart>
121
+ ```
122
+
123
+ ### Data Point Markers
124
+
125
+ Use the `d-size` attribute to control the size of data point markers on line and area charts. Default size is 1.
126
+
127
+ ```html:preview
128
+ <zn-chart
129
+ type="line"
130
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;]"
131
+ data="[{&quot;name&quot;:&quot;Small Markers&quot;,&quot;data&quot;:[30,40,35,50,49]}]"
132
+ d-size="1"
133
+ height="250">
134
+ </zn-chart>
135
+ <br />
136
+ <zn-chart
137
+ type="line"
138
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;]"
139
+ data="[{&quot;name&quot;:&quot;Large Markers&quot;,&quot;data&quot;:[30,40,35,50,49]}]"
140
+ d-size="6"
141
+ height="250">
142
+ </zn-chart>
143
+ ```
144
+
145
+ ### Y-Axis Formatting
146
+
147
+ Use `y-axis-append` to add a suffix to y-axis labels and tooltip values. Common uses include units like `%`, `$`, `K`, `M`, etc.
148
+
149
+ ```html:preview
150
+ <zn-chart
151
+ type="bar"
152
+ categories="[&quot;Product A&quot;,&quot;Product B&quot;,&quot;Product C&quot;]"
153
+ data="[{&quot;name&quot;:&quot;Market Share&quot;,&quot;data&quot;:[25,35,40]}]"
154
+ y-axis-append="%"
155
+ height="300">
156
+ </zn-chart>
157
+ <br />
158
+ <zn-chart
159
+ type="line"
160
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;]"
161
+ data="[{&quot;name&quot;:&quot;Revenue&quot;,&quot;data&quot;:[100,120,115,140]}]"
162
+ y-axis-append="K"
163
+ height="300">
164
+ </zn-chart>
165
+ ```
166
+
167
+ ### Time Series with X-Axis Type
168
+
169
+ Use the `x-axis` attribute to specify the x-axis type. Common values include `datetime`, `category`, and `numeric`.
170
+
171
+ ```html:preview
172
+ <zn-chart
173
+ type="line"
174
+ x-axis="datetime"
175
+ data="[{&quot;name&quot;:&quot;Traffic&quot;,&quot;data&quot;:[{&quot;x&quot;:1609459200000,&quot;y&quot;:30},{&quot;x&quot;:1612137600000,&quot;y&quot;:40},{&quot;x&quot;:1614556800000,&quot;y&quot;:35},{&quot;x&quot;:1617235200000,&quot;y&quot;:50},{&quot;x&quot;:1619827200000,&quot;y&quot;:49},{&quot;x&quot;:1622505600000,&quot;y&quot;:60}]}]"
176
+ height="300">
177
+ </zn-chart>
178
+ ```
179
+
180
+ :::tip
181
+ When using `x-axis="datetime"`, provide data in the format `[{x: timestamp, y: value}]` where `x` is a Unix timestamp in milliseconds. The chart will automatically format the dates on the x-axis.
182
+ :::
183
+
184
+ ### Enable Animations
185
+
186
+ By default, animations are disabled for better performance. Use the `enable-animations` attribute to enable chart animations.
187
+
188
+ ```html:preview
189
+ <zn-chart
190
+ type="bar"
191
+ categories="[&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;,&quot;E&quot;]"
192
+ data="[{&quot;name&quot;:&quot;Values&quot;,&quot;data&quot;:[44,55,41,37,52]}]"
193
+ enable-animations
194
+ height="300">
195
+ </zn-chart>
196
+ ```
197
+
198
+ ### Single Series Chart
199
+
200
+ For simple visualizations, use a single data series without multiple comparisons.
201
+
202
+ ```html:preview
203
+ <zn-chart
204
+ type="area"
205
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;]"
206
+ data="[{&quot;name&quot;:&quot;Page Views&quot;,&quot;data&quot;:[1200,1900,1500,2200,2400,2800,2600,3100]}]"
207
+ height="300">
208
+ </zn-chart>
209
+ ```
210
+
211
+ ### Empty State
212
+
213
+ When no data is available, the chart will display an empty state. Consider adding custom messaging around the chart component.
214
+
215
+ ```html:preview
216
+ <zn-chart
217
+ type="line"
218
+ categories="[]"
219
+ data="[]"
220
+ height="300">
221
+ </zn-chart>
222
+ ```
223
+
224
+ ### Dark Mode Support
225
+
226
+ The chart component automatically adapts to dark mode using the `t` attribute. The theme adjusts colors, gridlines, and text to match the current theme.
227
+
228
+ ```html:preview
229
+ <zn-chart
230
+ t="dark"
231
+ type="area"
232
+ categories="[&quot;Mon&quot;,&quot;Tue&quot;,&quot;Wed&quot;,&quot;Thu&quot;,&quot;Fri&quot;]"
233
+ data="[{&quot;name&quot;:&quot;Series 1&quot;,&quot;data&quot;:[30,40,35,50,49]},{&quot;name&quot;:&quot;Series 2&quot;,&quot;data&quot;:[25,35,30,45,42]}]"
234
+ height="300">
235
+ </zn-chart>
236
+ ```
237
+
238
+ ### Responsive Charts
239
+
240
+ Charts automatically resize to fit their container. The width adapts to the parent element while height is controlled by the `height` attribute.
241
+
242
+ ```html:preview
243
+ <div style="width: 100%; max-width: 600px;">
244
+ <zn-chart
245
+ type="bar"
246
+ categories="[&quot;Mobile&quot;,&quot;Desktop&quot;,&quot;Tablet&quot;]"
247
+ data="[{&quot;name&quot;:&quot;Sessions&quot;,&quot;data&quot;:[450,680,320]}]"
248
+ height="300">
249
+ </zn-chart>
250
+ </div>
251
+ ```
252
+
253
+ ### Combining Different Configurations
254
+
255
+ You can combine various attributes to create rich, informative charts.
256
+
257
+ ```html:preview
258
+ <zn-chart
259
+ type="line"
260
+ categories="[&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;]"
261
+ data="[{&quot;name&quot;:&quot;Target&quot;,&quot;data&quot;:[80,85,82,90,88,95,92,98]},{&quot;name&quot;:&quot;Actual&quot;,&quot;data&quot;:[75,82,78,88,91,97,94,102]}]"
262
+ d-size="4"
263
+ y-axis-append="%"
264
+ height="350"
265
+ enable-animations>
266
+ </zn-chart>
267
+ ```
268
+
269
+ ## Data Format
270
+
271
+ The chart component accepts data in JSON format through the `data` attribute. The data should be an array of series objects.
272
+
273
+ ### Basic Series Format
274
+
275
+ ```json
276
+ [
277
+ {
278
+ "name": "Series Name",
279
+ "data": [10, 20, 30, 40, 50]
280
+ }
281
+ ]
282
+ ```
283
+
284
+ ### Multiple Series Format
285
+
286
+ ```json
287
+ [
288
+ {
289
+ "name": "Series 1",
290
+ "data": [10, 20, 30, 40, 50]
291
+ },
292
+ {
293
+ "name": "Series 2",
294
+ "data": [15, 25, 35, 45, 55]
295
+ }
296
+ ]
297
+ ```
298
+
299
+ ### Time Series Format
300
+
301
+ When using `x-axis="datetime"`, use the coordinate format:
302
+
303
+ ```json
304
+ [
305
+ {
306
+ "name": "Time Series",
307
+ "data": [
308
+ {"x": 1609459200000, "y": 30},
309
+ {"x": 1612137600000, "y": 40},
310
+ {"x": 1614556800000, "y": 35}
311
+ ]
312
+ }
313
+ ]
314
+ ```
315
+
316
+ ### HTML Encoding
317
+
318
+ When using the data attribute in HTML, JSON must be properly encoded. Use `&quot;` for quotes:
319
+
320
+ ```html
321
+ <zn-chart
322
+ data="[{&quot;name&quot;:&quot;Sales&quot;,&quot;data&quot;:[10,20,30]}]"
323
+ categories="[&quot;A&quot;,&quot;B&quot;,&quot;C&quot;]">
324
+ </zn-chart>
325
+ ```
326
+
327
+ ## JavaScript API
328
+
329
+ You can also interact with the chart component using JavaScript:
330
+
331
+ ```javascript
332
+ // Get chart element
333
+ const chart = document.querySelector('zn-chart');
334
+
335
+ // Set data programmatically
336
+ chart.data = [
337
+ { name: 'Series 1', data: [10, 20, 30, 40] }
338
+ ];
339
+
340
+ // Set categories
341
+ chart.categories = ['Q1', 'Q2', 'Q3', 'Q4'];
342
+
343
+ // Change chart type
344
+ chart.type = 'bar';
345
+
346
+ // Update height
347
+ chart.height = 400;
348
+
349
+ // Enable animations
350
+ chart.enableAnimations = true;
351
+ ```
352
+
353
+ ## Best Practices
354
+
355
+ ### Choosing Chart Types
356
+
357
+ - **Line Charts**: Best for showing trends over time or continuous data
358
+ - **Bar Charts**: Ideal for comparing discrete categories or values
359
+ - **Area Charts**: Good for showing cumulative totals or part-to-whole relationships over time
360
+ - **Stacked Charts**: Use when showing how categories contribute to a total
361
+
362
+ ### Performance Considerations
363
+
364
+ - Keep the number of data points reasonable (under 1000 points for optimal performance)
365
+ - Disable animations by default for better initial render performance
366
+ - Use appropriate chart heights based on the amount of data being displayed
367
+ - Consider using the `live` mode only when necessary, as it can impact performance
368
+
369
+ ### Accessibility
20
370
 
21
- TODO
371
+ - Ensure chart data is also available in an accessible format (table, list, etc.)
372
+ - Use descriptive series names that clearly identify the data
373
+ - Choose appropriate colors that provide sufficient contrast
374
+ - Consider adding supplementary text descriptions for complex charts
22
375
 
23
- ### Second Example
376
+ ### Data Formatting
24
377
 
25
- TODO
378
+ - Use consistent units across related charts
379
+ - Round values appropriately for readability
380
+ - Use `y-axis-append` to add units or symbols to values
381
+ - Format dates consistently when using time series data
26
382
 
27
383