@@ -261,3 +261,116 @@ actions:
261261 result:
262262 type: currency
263263` ` `
264+
265+ # # 7. Chart Definition
266+
267+ Chart files define data visualizations based on object data. They use the naming convention `*.chart.yml` or `*.chart.yaml`.
268+
269+ # ## 7.1 Root Properties
270+
271+ | Property | Type | Description |
272+ | :--- | :--- | :--- |
273+ | `name` | `string` | **Required.** Unique API name of the chart. |
274+ | `label` | `string` | Human-readable label for the chart. |
275+ | `description` | `string` | Description of what the chart visualizes. |
276+ | `type` | `string` | **Required.** Chart type : ` bar` , `line`, `pie`, or `area`. |
277+ | `object` | `string` | **Required.** The object/entity to visualize data from. |
278+ | `xAxisKey` | `string` | **Required.** Field name for X-axis data. |
279+ | `yAxisKeys` | `string[]` | **Required.** Array of field names for Y-axis data series. |
280+ | `height` | `number` | Chart height in pixels. Default : ` 300` . |
281+ | `colors` | `string[]` | Custom color palette for chart series. |
282+ | `showGrid` | `boolean` | Whether to display grid lines. Default : ` true` . |
283+ | `showLegend` | `boolean` | Whether to display the legend. Default : ` true` . |
284+ | `showTooltip` | `boolean` | Whether to show tooltips on hover. Default : ` true` . |
285+ | `filters` | `array` | Optional filters to apply to the data query. |
286+ | `sort` | `array` | Sort criteria as `[field, direction]` pairs. |
287+
288+ # ## 7.2 Chart Types
289+
290+ **Bar Chart**: Best for comparing values across categories.
291+
292+ **Line Chart**: Ideal for showing trends over time.
293+
294+ **Area Chart**: Similar to line charts but with filled areas, great for cumulative data.
295+
296+ **Pie Chart**: Best for showing proportions and distributions (limit to 5-7 categories).
297+
298+ # ## 7.3 Example Chart Definitions
299+
300+ # ### Pie Chart Example
301+
302+ ` ` ` yaml
303+ name: projects_by_status
304+ label: Projects by Status
305+ description: Distribution of projects across different statuses
306+ type: pie
307+ object: projects
308+ xAxisKey: status
309+ yAxisKeys:
310+ - count
311+ height: 350
312+ showLegend: true
313+ showTooltip: true
314+ ` ` `
315+
316+ # ### Bar Chart with Custom Colors
317+
318+ ` ` ` yaml
319+ name: projects_by_priority
320+ label: Projects by Priority
321+ description: Bar chart showing project distribution by priority level
322+ type: bar
323+ object: projects
324+ xAxisKey: priority
325+ yAxisKeys:
326+ - count
327+ height: 300
328+ showGrid: true
329+ showLegend: true
330+ showTooltip: true
331+ colors:
332+ - '#FF6F2C' # High priority (Orange)
333+ - '#FFC940' # Normal priority (Yellow)
334+ - '#20C933' # Low priority (Green)
335+ ` ` `
336+
337+ # ### Multi-Series Area Chart
338+
339+ ` ` ` yaml
340+ name: tasks_completion
341+ label: Task Completion Trend
342+ description: Track task completion progress over time
343+ type: area
344+ object: tasks
345+ xAxisKey: due_date
346+ yAxisKeys:
347+ - completed_count
348+ - total_count
349+ height: 350
350+ showGrid: true
351+ showLegend: true
352+ showTooltip: true
353+ colors:
354+ - '#20C933'
355+ - '#2D7FF9'
356+ ` ` `
357+
358+ # ### Bar Chart with Sorting
359+
360+ ` ` ` yaml
361+ name: project_budget
362+ label: Project Budget Overview
363+ description: Visualize total budget allocated for each project
364+ type: bar
365+ object: projects
366+ xAxisKey: name
367+ yAxisKeys:
368+ - budget
369+ height: 400
370+ showGrid: true
371+ showLegend: true
372+ showTooltip: true
373+ sort:
374+ - - budget
375+ - desc
376+ ` ` `
0 commit comments