diff --git a/ar/features/report.mdx b/ar/features/report.mdx index 24680a1..f9d4fb2 100644 --- a/ar/features/report.mdx +++ b/ar/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | جدول محوري متقاطع | تحليل متعدد الأبعاد | | **gauge** | مقياس | تتبع التقدم أو الأهداف | | **funnel** | رسم بياني قمعي | التحويل عبر المراحل | +| **radar** | رسم بياني رادار | مقارنة متعددة المتغيرات | --- @@ -179,6 +180,99 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ } ``` +### مؤشر (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### مقياس + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### رسم بياني رادار + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## رموز الحقول في التقارير + +عند الإشارة إلى حقول النموذج في تعريفات الرسوم البيانية للتقارير، تستخدم معظم أنواع الحقول معرّف الحقل مباشرة (مثل `textField_abc123`). ومع ذلك، تتطلب الحقول من نوع الاختيار — مثل `SelectField` و `RadioField` و `CheckboxField` و `EmployeeField` و `DepartmentSelectField` — إضافة اللاحقة `_value` إلى معرّف الحقل. + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +استخدم `openyida get-schema` للحصول على هيكل النموذج وتحديد رموز الحقول الصحيحة لرسومك البيانية. + + + +استخدام معرّف الحقل بدون اللاحقة `_value` للحقول من نوع الاختيار سيؤدي إلى بيانات فارغة أو غير صحيحة في الرسم البياني. + + +--- + +## تنسيق الحقل البديل + +بدلاً من استخدام `xField` و `yField` كسلاسل نصية، يمكنك استخدام مصفوفة `fields` لتحديد مقاييس متعددة مع أنواع تجميع فردية: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +هذا التنسيق مفيد بشكل خاص للرسوم البيانية المركبة ورسوم الرادار التي تحتاج إلى عرض مقاييس متعددة على نفس التصور. + +--- + +## المرشحات + +تُنشئ الحقول من نوع الاختيار (SelectField و RadioField و CheckboxField وغيرها) مرشحات تلقائيًا في التقرير. عندما يستخدم الرسم البياني حقلاً من نوع الاختيار كـ `xField`، تعرض واجهة التقرير قائمة منسدلة للتصفية تتيح للمستخدمين تصفية بيانات الرسم البياني بشكل تفاعلي. + +لا حاجة لأي تكوين إضافي — يتم إنشاء المرشحات بناءً على نوع الحقل في هيكل النموذج. + --- ## دوال التجميع @@ -190,6 +284,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **count** | العد | | **max** | القيمة القصوى | | **min** | القيمة الدنيا | +| **count_distinct** | عدد القيم الفريدة | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## التحقق من التكوين + +قبل إنشاء التقرير، تحقق من تكوين الرسوم البيانية لتجنب الأخطاء الشائعة: + +1. **تحقق من رموز الحقول** — قم بتشغيل `openyida get-schema` للتحقق من معرّفات الحقول والتأكد من أن الحقول من نوع الاختيار تتضمن اللاحقة `_value`. +2. **تحقق من مصدر البيانات** — تأكد من أن `dataSource` أو `cubeCode` يطابق UUID نموذج صالح في تطبيقك. +3. **تحقق من أنواع التجميع** — تأكد من أن دالة التجميع متوافقة مع نوع الحقل (مثلاً، `sum` يعمل فقط على الحقول الرقمية). +4. **اختبر برسم بياني واحد** — ابدأ برسم بياني واحد للتحقق من التكوين قبل إضافة عدة رسوم بيانية. + +--- + ## أفضل الممارسات 1. **اختر نوع الرسم البياني المناسب** - الاتجاهات بالخطي، المقارنات بالعمودي، النسب بالدائري 2. **تحكم في عدد الرسوم البيانية** - يُنصح بعدم تجاوز 6 رسوم بيانية لكل تقرير 3. **استخدم جداول البيانات** - أكمل الرسوم البيانية بجداول لفحص البيانات المفصلة 4. **اضبط أحجام الصفحات المناسبة** - يُنصح بـ 10-20 سجلًا لكل صفحة للجداول +5. **استخدم get-schema لاكتشاف الحقول** - قم بتشغيل `openyida get-schema` للحصول على رموز الحقول الصحيحة قبل بناء تعريفات الرسوم البيانية +6. **استفد من المرشحات التلقائية** - تُنشئ الحقول من نوع الاختيار مرشحات تقارير تلقائيًا، استخدمها كـ `xField` للوحات المعلومات التفاعلية diff --git a/ar/features/skills.mdx b/ar/features/skills.mdx index 8abb53e..02e8a39 100644 --- a/ar/features/skills.mdx +++ b/ar/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "<اسم النموذج>" -# الحصول على Schema النموذج +# الحصول على Schema النموذج (يُرجع معرّفات الحقول ورموز حقول التقارير) openyida get-schema # تحديث تكوين النموذج diff --git a/de/features/report.mdx b/de/features/report.mdx index cab0797..f696633 100644 --- a/de/features/report.mdx +++ b/de/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | Kreuz-Pivottabelle | Mehrdimensionale Analyse | | **gauge** | Messgerät-Diagramm | Fortschritts- oder Zielverfolgung | | **funnel** | Trichterdiagramm | Stufenweise Konversion | +| **radar** | Radardiagramm | Mehrvariablenvergleich | --- @@ -179,6 +180,99 @@ Das Setzen von `w` oder `h` auf `0` ist gültig und wird berücksichtigt. Bei Au } ``` +### Kennzahl (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### Tachometer + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### Radardiagramm + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## Feldcodes für Berichte + +Beim Referenzieren von Formularfeldern in Berichts-Diagrammdefinitionen verwenden die meisten Feldtypen ihre Feld-ID direkt (z.B. `textField_abc123`). Auswahlfelder — wie `SelectField`, `RadioField`, `CheckboxField`, `EmployeeField` und `DepartmentSelectField` — erfordern jedoch das Anhängen des Suffixes `_value` an die Feld-ID. + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +Verwenden Sie `openyida get-schema`, um das Formularschema abzurufen und die korrekten Feldcodes für Ihre Berichtsdiagramme zu ermitteln. + + + +Die Verwendung einer Feld-ID ohne das Suffix `_value` für Auswahlfelder führt zu leeren oder falschen Daten im Diagramm. + + +--- + +## Alternatives Feldformat + +Anstatt `xField` und `yField` als Zeichenketten zu verwenden, können Sie ein `fields`-Array verwenden, um mehrere Kennzahlen mit individuellen Aggregationstypen anzugeben: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +Dieses Format ist besonders nützlich für Kombi-Diagramme und Radardiagramme, die mehrere Kennzahlen in derselben Visualisierung anzeigen müssen. + +--- + +## Filter + +Auswahlfelder (SelectField, RadioField, CheckboxField usw.) erzeugen automatisch Filter im Bericht. Wenn ein Diagramm ein Auswahlfeld als `xField` verwendet, zeigt die Berichts-UI ein Filter-Dropdown an, mit dem Benutzer die Diagrammdaten interaktiv filtern können. + +Es ist keine zusätzliche Konfiguration erforderlich — Filter werden basierend auf dem Feldtyp im Formularschema automatisch generiert. + --- ## Aggregationsfunktionen @@ -190,6 +284,7 @@ Das Setzen von `w` oder `h` auf `0` ist gültig und wird berücksichtigt. Bei Au | **count** | Anzahl der Datensätze | | **max** | Maximalwert | | **min** | Minimalwert | +| **count_distinct** | Anzahl eindeutiger Werte | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## Konfigurationsvalidierung + +Bevor Sie einen Bericht erstellen, validieren Sie Ihre Diagrammkonfiguration, um häufige Fehler zu vermeiden: + +1. **Feldcodes prüfen** — Führen Sie `openyida get-schema` aus, um Feld-IDs zu überprüfen und sicherzustellen, dass Auswahlfelder das Suffix `_value` enthalten. +2. **Datenquelle überprüfen** — Stellen Sie sicher, dass `dataSource` oder `cubeCode` einer gültigen Formular-UUID in Ihrer Anwendung entspricht. +3. **Aggregationstypen validieren** — Bestätigen Sie, dass die Aggregationsfunktion mit dem Feldtyp kompatibel ist (z.B. `sum` funktioniert nur bei Zahlenfeldern). +4. **Mit einem einzelnen Diagramm testen** — Beginnen Sie mit einem Diagramm, um die Konfiguration zu überprüfen, bevor Sie mehrere hinzufügen. + +--- + ## Best Practices 1. **Wählen Sie den passenden Diagrammtyp** - Liniendiagramme für Trends, Balkendiagramme für Vergleiche, Kreisdiagramme für Anteile 2. **Begrenzen Sie die Diagrammanzahl** - Maximal 6 Diagramme pro Bericht 3. **Verwenden Sie Datentabellen** - Ergänzen Sie Diagramme mit Tabellen zur detaillierten Datenprüfung 4. **Legen Sie angemessene Seitengrößen fest** - Für Datentabellen 10-20 Zeilen pro Seite +5. **Verwenden Sie get-schema zur Felderkennung** - Führen Sie `openyida get-schema` aus, um korrekte Feldcodes vor dem Erstellen von Diagrammdefinitionen abzurufen +6. **Nutzen Sie automatische Filter** - Auswahlfelder erzeugen automatisch Berichtsfilter, verwenden Sie sie als `xField` für interaktive Dashboards diff --git a/de/features/skills.mdx b/de/features/skills.mdx index cf5fff1..40cb681 100644 --- a/de/features/skills.mdx +++ b/de/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "" \ # Formular aktualisieren openyida create-form update <ÄnderungenJSON> -# Formular-Schema abrufen +# Formular-Schema abrufen (gibt Feld-IDs und Berichts-Feldcodes zurück) openyida get-schema # Formularkonfiguration aktualisieren diff --git a/en/features/report.mdx b/en/features/report.mdx index 625001e..46c405d 100644 --- a/en/features/report.mdx +++ b/en/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | Cross pivot table | Multi-dimensional analysis | | **gauge** | Gauge chart | Progress or target tracking | | **funnel** | Funnel chart | Stage-based conversion | +| **radar** | Radar chart | Multi-variable comparison | --- @@ -179,6 +180,99 @@ Setting `w` or `h` to `0` is valid and will be respected. If omitted, the defaul } ``` +### Indicator (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### Gauge + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### Radar + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## Field codes in reports + +When referencing form fields in report chart definitions, most field types use their field ID directly (e.g. `textField_abc123`). However, select-like fields — such as `SelectField`, `RadioField`, `CheckboxField`, `EmployeeField`, and `DepartmentSelectField` — require a `_value` suffix appended to the field ID. + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +Use `openyida get-schema` to retrieve the form schema and identify the correct field codes for your report charts. + + + +Using a field ID without the `_value` suffix for select-like fields will result in empty or incorrect data in the chart. + + +--- + +## Alternative field format + +Instead of using `xField` and `yField` as strings, you can use a `fields` array to specify multiple measures with individual aggregation types: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +This format is especially useful for combo charts and radar charts that need to display multiple metrics on the same visualization. + +--- + +## Filters + +Select-like fields (SelectField, RadioField, CheckboxField, etc.) automatically generate filters in the report. When a chart uses a select-like field as the `xField`, the report UI will display a filter dropdown allowing users to filter the chart data interactively. + +No additional configuration is needed — filters are generated based on the field type in the form schema. + --- ## Aggregation functions @@ -190,6 +284,7 @@ Setting `w` or `h` to `0` is valid and will be respected. If omitted, the defaul | **count** | Count of records | | **max** | Maximum value | | **min** | Minimum value | +| **count_distinct** | Count of unique values | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## Configuration validation + +Before creating a report, validate your chart configuration to avoid common errors: + +1. **Check field codes** — Run `openyida get-schema` to verify field IDs and ensure select-like fields include the `_value` suffix. +2. **Verify data source** — Ensure the `dataSource` or `cubeCode` matches a valid form UUID in your application. +3. **Validate aggregation types** — Confirm that the aggregation function is compatible with the field type (e.g., `sum` only works on number fields). +4. **Test with a single chart** — Start with one chart to verify the configuration before adding multiple charts. + +--- + ## Best practices 1. **Choose appropriate chart types** - Use line charts for trends, bar charts for comparisons, pie charts for proportions 2. **Limit chart count** - Keep reports to 6 or fewer charts 3. **Include data tables** - Pair charts with tables for detailed data inspection 4. **Set reasonable page sizes** - For data tables, use 10-20 rows per page +5. **Use get-schema for field discovery** - Run `openyida get-schema` to retrieve correct field codes before building chart definitions +6. **Leverage auto-filters** - Select-like fields automatically generate report filters, so use them as `xField` for interactive dashboards diff --git a/en/features/skills.mdx b/en/features/skills.mdx index 897b5f1..d8ac9c6 100644 --- a/en/features/skills.mdx +++ b/en/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "
" \ # Update form openyida create-form update -# Get form schema +# Get form schema (returns field IDs and report field codes) openyida get-schema # Update form config diff --git a/es/features/report.mdx b/es/features/report.mdx index cb6c6a5..9478765 100644 --- a/es/features/report.mdx +++ b/es/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | Tabla dinámica cruzada | Análisis multidimensional | | **gauge** | Gráfico de velocímetro | Seguimiento de progreso u objetivos | | **funnel** | Gráfico de embudo | Conversión por etapas | +| **radar** | Gráfico radar | Comparación multivariable | --- @@ -179,6 +180,99 @@ Establecer `w` o `h` en `0` es válido y será respetado. Si se omite, se usan l } ``` +### Indicador (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### Indicador de aguja + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### Gráfico radar + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## Códigos de campo para informes + +Al hacer referencia a campos de formulario en las definiciones de gráficos, la mayoría de los tipos de campo usan su ID de campo directamente (p. ej. `textField_abc123`). Sin embargo, los campos de tipo selección — como `SelectField`, `RadioField`, `CheckboxField`, `EmployeeField` y `DepartmentSelectField` — requieren agregar el sufijo `_value` al ID del campo. + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +Usa `openyida get-schema` para obtener el esquema del formulario e identificar los códigos de campo correctos para tus gráficos. + + + +Usar un ID de campo sin el sufijo `_value` para campos de tipo selección resultará en datos vacíos o incorrectos en el gráfico. + + +--- + +## Formato de campo alternativo + +En lugar de usar `xField` y `yField` como cadenas, puedes usar un arreglo `fields` para especificar múltiples medidas con tipos de agregación individuales: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +Este formato es especialmente útil para gráficos combinados y gráficos radar que necesitan mostrar múltiples métricas en la misma visualización. + +--- + +## Filtros + +Los campos de tipo selección (SelectField, RadioField, CheckboxField, etc.) generan automáticamente filtros en el informe. Cuando un gráfico usa un campo de tipo selección como `xField`, la interfaz del informe muestra un menú desplegable de filtro que permite a los usuarios filtrar los datos del gráfico de forma interactiva. + +No se necesita configuración adicional — los filtros se generan en función del tipo de campo en el esquema del formulario. + --- ## Funciones de agregación @@ -190,6 +284,7 @@ Establecer `w` o `h` en `0` es válido y será respetado. Si se omite, se usan l | **count** | Conteo de registros | | **max** | Valor máximo | | **min** | Valor mínimo | +| **count_distinct** | Conteo de valores únicos | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## Validación de configuración + +Antes de crear un informe, valida la configuración de tus gráficos para evitar errores comunes: + +1. **Verifica los códigos de campo** — Ejecuta `openyida get-schema` para verificar los ID de campo y asegurarte de que los campos de tipo selección incluyen el sufijo `_value`. +2. **Verifica la fuente de datos** — Asegúrate de que `dataSource` o `cubeCode` coincida con un UUID de formulario válido en tu aplicación. +3. **Valida los tipos de agregación** — Confirma que la función de agregación es compatible con el tipo de campo (p. ej., `sum` solo funciona en campos numéricos). +4. **Prueba con un solo gráfico** — Comienza con un gráfico para verificar la configuración antes de agregar varios. + +--- + ## Mejores prácticas 1. **Elige el tipo de gráfico apropiado** - Gráficos de líneas para tendencias, de barras para comparaciones, circulares para proporciones 2. **Limita la cantidad de gráficos** - Mantén los informes con 6 gráficos o menos 3. **Incluye tablas de datos** - Complementa los gráficos con tablas para inspección detallada 4. **Configura tamaños de página razonables** - Para tablas de datos, usa 10-20 filas por página +5. **Usa get-schema para descubrir campos** - Ejecuta `openyida get-schema` para obtener los códigos de campo correctos antes de construir las definiciones de gráficos +6. **Aprovecha los filtros automáticos** - Los campos de tipo selección generan automáticamente filtros de informe, úsalos como `xField` para paneles interactivos diff --git a/es/features/skills.mdx b/es/features/skills.mdx index c04e1ce..93772d5 100644 --- a/es/features/skills.mdx +++ b/es/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "" \ # Actualizar formulario openyida create-form update -# Obtener Schema del formulario +# Obtener Schema del formulario (devuelve IDs de campo y códigos de campo para informes) openyida get-schema # Actualizar configuración del formulario diff --git a/fr/features/report.mdx b/fr/features/report.mdx index 9c538fc..0a5e067 100644 --- a/fr/features/report.mdx +++ b/fr/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | Tableau croisé dynamique | Analyse multidimensionnelle | | **gauge** | Jauge | Suivi de progression ou d'objectifs | | **funnel** | Graphique en entonnoir | Conversion par étapes | +| **radar** | Graphique radar | Comparaison multivariable | --- @@ -179,6 +180,99 @@ Définir `w` ou `h` à `0` est valide et sera respecté. Si omis, les valeurs pa } ``` +### Indicateur (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### Jauge + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### Graphique radar + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## Codes de champs pour les rapports + +Lors du référencement de champs de formulaire dans les définitions de graphiques, la plupart des types de champs utilisent directement leur ID de champ (par ex. `textField_abc123`). Cependant, les champs de type sélection — tels que `SelectField`, `RadioField`, `CheckboxField`, `EmployeeField` et `DepartmentSelectField` — nécessitent l'ajout du suffixe `_value` à l'ID du champ. + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +Utilisez `openyida get-schema` pour récupérer le schéma du formulaire et identifier les codes de champs corrects pour vos graphiques. + + + +L'utilisation d'un ID de champ sans le suffixe `_value` pour les champs de type sélection entraînera des données vides ou incorrectes dans le graphique. + + +--- + +## Format de champ alternatif + +Au lieu d'utiliser `xField` et `yField` comme chaînes de caractères, vous pouvez utiliser un tableau `fields` pour spécifier plusieurs mesures avec des types d'agrégation individuels : + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +Ce format est particulièrement utile pour les graphiques combinés et les graphiques radar qui doivent afficher plusieurs métriques sur la même visualisation. + +--- + +## Filtres + +Les champs de type sélection (SelectField, RadioField, CheckboxField, etc.) génèrent automatiquement des filtres dans le rapport. Lorsqu'un graphique utilise un champ de type sélection comme `xField`, l'interface du rapport affiche un menu déroulant de filtrage permettant aux utilisateurs de filtrer les données du graphique de manière interactive. + +Aucune configuration supplémentaire n'est nécessaire — les filtres sont générés en fonction du type de champ dans le schéma du formulaire. + --- ## Fonctions d'agrégation @@ -190,6 +284,7 @@ Définir `w` ou `h` à `0` est valide et sera respecté. Si omis, les valeurs pa | **count** | Nombre d'enregistrements | | **max** | Valeur maximale | | **min** | Valeur minimale | +| **count_distinct** | Nombre de valeurs uniques | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## Validation de la configuration + +Avant de créer un rapport, validez la configuration de vos graphiques pour éviter les erreurs courantes : + +1. **Vérifiez les codes de champs** — Exécutez `openyida get-schema` pour vérifier les ID de champs et vous assurer que les champs de type sélection incluent le suffixe `_value`. +2. **Vérifiez la source de données** — Assurez-vous que `dataSource` ou `cubeCode` correspond à un UUID de formulaire valide dans votre application. +3. **Validez les types d'agrégation** — Confirmez que la fonction d'agrégation est compatible avec le type de champ (par ex., `sum` ne fonctionne que sur les champs numériques). +4. **Testez avec un seul graphique** — Commencez par un graphique pour vérifier la configuration avant d'en ajouter plusieurs. + +--- + ## Meilleures pratiques 1. **Choisissez le type de graphique approprié** - Graphiques linéaires pour les tendances, à barres pour les comparaisons, circulaires pour les proportions 2. **Limitez le nombre de graphiques** - Gardez 6 graphiques ou moins par rapport 3. **Incluez des tableaux de données** - Associez des tableaux aux graphiques pour une inspection détaillée 4. **Définissez des tailles de page raisonnables** - Pour les tableaux de données, utilisez 10-20 lignes par page +5. **Utilisez get-schema pour découvrir les champs** - Exécutez `openyida get-schema` pour obtenir les codes de champs corrects avant de construire les définitions de graphiques +6. **Tirez parti des filtres automatiques** - Les champs de type sélection génèrent automatiquement des filtres de rapport, utilisez-les comme `xField` pour des tableaux de bord interactifs diff --git a/fr/features/skills.mdx b/fr/features/skills.mdx index 0444201..ff6b9c3 100644 --- a/fr/features/skills.mdx +++ b/fr/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "" \ # Mettre à jour un formulaire openyida create-form update -# Obtenir le Schema du formulaire +# Obtenir le Schema du formulaire (retourne les ID de champs et codes de champs pour les rapports) openyida get-schema # Mettre à jour la configuration du formulaire diff --git a/hi/features/report.mdx b/hi/features/report.mdx index 0567c5a..09293a8 100644 --- a/hi/features/report.mdx +++ b/hi/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | क्रॉस पिवट टेबल | बहु-आयामी विश्लेषण | | **gauge** | गेज चार्ट | प्रगति या लक्ष्य ट्रैकिंग | | **funnel** | फ़नल चार्ट | चरणबद्ध रूपांतरण | +| **radar** | रडार चार्ट | बहु-चर तुलना | --- @@ -179,6 +180,99 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ } ``` +### संकेतक (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### गेज + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### रडार चार्ट + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## रिपोर्ट फ़ील्ड कोड + +रिपोर्ट चार्ट परिभाषाओं में फॉर्म फ़ील्ड का संदर्भ देते समय, अधिकांश फ़ील्ड प्रकार सीधे अपने फ़ील्ड ID का उपयोग करते हैं (जैसे `textField_abc123`)। हालांकि, चयन-प्रकार के फ़ील्ड — जैसे `SelectField`, `RadioField`, `CheckboxField`, `EmployeeField`, और `DepartmentSelectField` — को फ़ील्ड ID में `_value` प्रत्यय जोड़ने की आवश्यकता होती है। + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +फॉर्म स्कीमा प्राप्त करने और अपने रिपोर्ट चार्ट के लिए सही फ़ील्ड कोड की पहचान करने के लिए `openyida get-schema` का उपयोग करें। + + + +चयन-प्रकार के फ़ील्ड के लिए `_value` प्रत्यय के बिना फ़ील्ड ID का उपयोग करने से चार्ट में खाली या गलत डेटा प्रदर्शित होगा। + + +--- + +## वैकल्पिक फ़ील्ड प्रारूप + +`xField` और `yField` को स्ट्रिंग के रूप में उपयोग करने के बजाय, आप व्यक्तिगत एग्रीगेशन प्रकारों के साथ कई माप निर्दिष्ट करने के लिए `fields` ऐरे का उपयोग कर सकते हैं: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +यह प्रारूप विशेष रूप से कॉम्बो चार्ट और रडार चार्ट के लिए उपयोगी है जिन्हें एक ही विज़ुअलाइज़ेशन में कई मेट्रिक्स प्रदर्शित करने की आवश्यकता होती है। + +--- + +## फ़िल्टर + +चयन-प्रकार के फ़ील्ड (SelectField, RadioField, CheckboxField, आदि) स्वचालित रूप से रिपोर्ट में फ़िल्टर उत्पन्न करते हैं। जब कोई चार्ट चयन-प्रकार के फ़ील्ड को `xField` के रूप में उपयोग करता है, तो रिपोर्ट UI एक फ़िल्टर ड्रॉपडाउन प्रदर्शित करता है जो उपयोगकर्ताओं को चार्ट डेटा को इंटरैक्टिव रूप से फ़िल्टर करने की अनुमति देता है। + +कोई अतिरिक्त कॉन्फ़िगरेशन आवश्यक नहीं है — फ़िल्टर फॉर्म स्कीमा में फ़ील्ड प्रकार के आधार पर स्वचालित रूप से उत्पन्न होते हैं। + --- ## एग्रीगेशन फ़ंक्शन @@ -190,6 +284,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **count** | रिकॉर्ड की गणना | | **max** | अधिकतम मान | | **min** | न्यूनतम मान | +| **count_distinct** | अद्वितीय मानों की गणना | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## कॉन्फ़िगरेशन सत्यापन + +रिपोर्ट बनाने से पहले, सामान्य त्रुटियों से बचने के लिए अपने चार्ट कॉन्फ़िगरेशन को सत्यापित करें: + +1. **फ़ील्ड कोड जांचें** — `openyida get-schema` चलाकर फ़ील्ड ID सत्यापित करें और सुनिश्चित करें कि चयन-प्रकार के फ़ील्ड में `_value` प्रत्यय शामिल है। +2. **डेटा स्रोत सत्यापित करें** — सुनिश्चित करें कि `dataSource` या `cubeCode` आपके एप्लिकेशन में एक मान्य फॉर्म UUID से मेल खाता है। +3. **एग्रीगेशन प्रकार मान्य करें** — पुष्टि करें कि एग्रीगेशन फ़ंक्शन फ़ील्ड प्रकार के साथ संगत है (उदा., `sum` केवल संख्या फ़ील्ड पर काम करता है)। +4. **एकल चार्ट से परीक्षण करें** — कई चार्ट जोड़ने से पहले एक चार्ट से कॉन्फ़िगरेशन सत्यापित करें। + +--- + ## सर्वोत्तम अभ्यास 1. **उचित चार्ट प्रकार चुनें** - प्रवृत्तियों के लिए लाइन चार्ट, तुलना के लिए बार चार्ट, अनुपात के लिए पाई चार्ट 2. **चार्ट की संख्या सीमित रखें** - प्रति रिपोर्ट 6 या उससे कम चार्ट रखें 3. **डेटा टेबल शामिल करें** - विस्तृत डेटा निरीक्षण के लिए चार्ट के साथ टेबल जोड़ें 4. **उचित पेज साइज़ सेट करें** - डेटा टेबल के लिए प्रति पृष्ठ 10-20 पंक्तियां उपयोग करें +5. **get-schema से फ़ील्ड खोजें** - चार्ट परिभाषा बनाने से पहले सही फ़ील्ड कोड प्राप्त करने के लिए `openyida get-schema` चलाएं +6. **ऑटो-फ़िल्टर का लाभ उठाएं** - चयन-प्रकार के फ़ील्ड स्वचालित रूप से रिपोर्ट फ़िल्टर उत्पन्न करते हैं, इंटरैक्टिव डैशबोर्ड के लिए उन्हें `xField` के रूप में उपयोग करें diff --git a/hi/features/skills.mdx b/hi/features/skills.mdx index 40f12d1..9a81887 100644 --- a/hi/features/skills.mdx +++ b/hi/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "<नाम>" <फ़ील्डJSON> \ # फॉर्म अपडेट करें openyida create-form update <संशोधनJSON> -# फॉर्म Schema प्राप्त करें +# फॉर्म Schema प्राप्त करें (फ़ील्ड ID और रिपोर्ट फ़ील्ड कोड लौटाता है) openyida get-schema # फॉर्म कॉन्फ़िगरेशन अपडेट करें diff --git a/ja/features/report.mdx b/ja/features/report.mdx index 1b84d2f..eea0bb7 100644 --- a/ja/features/report.mdx +++ b/ja/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | クロスピボットテーブル | 多次元分析 | | **gauge** | ゲージチャート | 進捗や目標の追跡 | | **funnel** | ファネルチャート | 段階別のコンバージョン | +| **radar** | レーダーチャート | 多変数の比較 | --- @@ -179,6 +180,99 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ } ``` +### 指標カード (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### ゲージ + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### レーダーチャート + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## レポートフィールドコード + +レポートチャート定義でフォームフィールドを参照する場合、ほとんどのフィールドタイプはフィールド ID をそのまま使用します(例:`textField_abc123`)。ただし、選択系フィールド — `SelectField`、`RadioField`、`CheckboxField`、`EmployeeField`、`DepartmentSelectField` — はフィールド ID に `_value` サフィックスを追加する必要があります。 + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +`openyida get-schema` を使用してフォームスキーマを取得し、レポートチャートの正しいフィールドコードを確認してください。 + + + +選択系フィールドに `_value` サフィックスなしのフィールド ID を使用すると、チャートのデータが空になるか不正確になります。 + + +--- + +## 代替フィールド形式 + +`xField` と `yField` を文字列として使用する代わりに、`fields` 配列を使用して個別の集計タイプを持つ複数のメジャーを指定できます: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +この形式は、同じビジュアライゼーションで複数の指標を表示する必要があるコンボチャートやレーダーチャートに特に便利です。 + +--- + +## フィルター + +選択系フィールド(SelectField、RadioField、CheckboxField など)は、レポートで自動的にフィルターを生成します。チャートが選択系フィールドを `xField` として使用すると、レポート UI にフィルタードロップダウンが表示され、ユーザーがチャートデータを対話的にフィルタリングできます。 + +追加の設定は不要です — フィルターはフォームスキーマのフィールドタイプに基づいて自動的に生成されます。 + --- ## 集計関数 @@ -190,6 +284,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **count** | レコード数 | | **max** | 最大値 | | **min** | 最小値 | +| **count_distinct** | ユニーク値のカウント | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## 設定の検証 + +レポートを作成する前に、チャート設定を検証して一般的なエラーを回避してください: + +1. **フィールドコードを確認** — `openyida get-schema` を実行してフィールド ID を確認し、選択系フィールドに `_value` サフィックスが含まれていることを確認します。 +2. **データソースを確認** — `dataSource` または `cubeCode` がアプリケーション内の有効なフォーム UUID と一致することを確認します。 +3. **集計タイプを確認** — 集計関数がフィールドタイプと互換性があることを確認します(例:`sum` は数値フィールドでのみ機能します)。 +4. **単一チャートでテスト** — 複数のチャートを追加する前に、1つのチャートで設定を確認します。 + +--- + ## ベストプラクティス 1. **適切なチャートタイプを選択** - トレンドは折れ線グラフ、比較は棒グラフ、比率は円グラフ 2. **チャート数を制限** - レポートあたり6つ以下のチャートに抑える 3. **データテーブルを含める** - 詳細なデータ検査のためにチャートとテーブルを組み合わせる 4. **適切なページサイズを設定** - データテーブルは1ページあたり10-20行を推奨 +5. **get-schema でフィールドを確認** - チャート定義を構築する前に `openyida get-schema` を実行して正しいフィールドコードを取得する +6. **自動フィルターを活用** - 選択系フィールドは自動的にレポートフィルターを生成するため、インタラクティブなダッシュボードには `xField` として使用する diff --git a/ja/features/skills.mdx b/ja/features/skills.mdx index aec307f..31e43ad 100644 --- a/ja/features/skills.mdx +++ b/ja/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "<表单名>" <字段JSON> \ # フォーム更新 openyida create-form update <修改JSON> -# フォームSchema取得 +# フォームSchema取得(フィールドIDとレポートフィールドコードを返す) openyida get-schema # フォーム設定更新 diff --git a/ko/features/report.mdx b/ko/features/report.mdx index 7456718..9270d05 100644 --- a/ko/features/report.mdx +++ b/ko/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | 크로스 피벗 테이블 | 다차원 분석 | | **gauge** | 게이지 차트 | 진행률 또는 목표 추적 | | **funnel** | 퍼널 차트 | 단계별 전환 | +| **radar** | 레이더 차트 | 다변수 비교 | --- @@ -179,6 +180,99 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ } ``` +### 지표 카드 (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### 게이지 + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### 레이더 차트 + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## 보고서 필드 코드 + +보고서 차트 정의에서 양식 필드를 참조할 때, 대부분의 필드 유형은 필드 ID를 직접 사용합니다(예: `textField_abc123`). 그러나 선택형 필드 — `SelectField`, `RadioField`, `CheckboxField`, `EmployeeField`, `DepartmentSelectField` — 는 필드 ID에 `_value` 접미사를 추가해야 합니다. + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +`openyida get-schema`를 사용하여 양식 스키마를 가져오고 보고서 차트에 올바른 필드 코드를 확인하세요. + + + +선택형 필드에 `_value` 접미사 없이 필드 ID를 사용하면 차트에 빈 데이터 또는 잘못된 데이터가 표시됩니다. + + +--- + +## 대체 필드 형식 + +`xField`와 `yField`를 문자열로 사용하는 대신, `fields` 배열을 사용하여 개별 집계 유형을 가진 여러 측정값을 지정할 수 있습니다: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +이 형식은 동일한 시각화에 여러 지표를 표시해야 하는 콤보 차트와 레이더 차트에 특히 유용합니다. + +--- + +## 필터 + +선택형 필드(SelectField, RadioField, CheckboxField 등)는 보고서에서 자동으로 필터를 생성합니다. 차트가 선택형 필드를 `xField`로 사용하면, 보고서 UI에 필터 드롭다운이 표시되어 사용자가 차트 데이터를 대화형으로 필터링할 수 있습니다. + +추가 구성은 필요 없습니다 — 필터는 양식 스키마의 필드 유형에 따라 자동으로 생성됩니다. + --- ## 집계 함수 @@ -190,6 +284,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **count** | 레코드 수 | | **max** | 최대 값 | | **min** | 최소 값 | +| **count_distinct** | 고유 값 수 | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## 구성 유효성 검사 + +보고서를 만들기 전에 차트 구성을 검증하여 일반적인 오류를 방지하세요: + +1. **필드 코드 확인** — `openyida get-schema`를 실행하여 필드 ID를 확인하고 선택형 필드에 `_value` 접미사가 포함되어 있는지 확인합니다. +2. **데이터 소스 확인** — `dataSource` 또는 `cubeCode`가 애플리케이션의 유효한 양식 UUID와 일치하는지 확인합니다. +3. **집계 유형 검증** — 집계 함수가 필드 유형과 호환되는지 확인합니다(예: `sum`은 숫자 필드에서만 작동). +4. **단일 차트로 테스트** — 여러 차트를 추가하기 전에 하나의 차트로 구성을 확인합니다. + +--- + ## 모범 사례 1. **적절한 차트 유형 선택** - 추세에는 꺾은선형, 비교에는 막대형, 비율에는 원형 차트 사용 2. **차트 수 제한** - 보고서당 6개 이하의 차트 유지 3. **데이터 테이블 포함** - 상세 데이터 검사를 위해 차트와 테이블을 함께 사용 4. **적절한 페이지 크기 설정** - 데이터 테이블은 페이지당 10-20행 사용 +5. **get-schema로 필드 확인** - 차트 정의를 작성하기 전에 `openyida get-schema`를 실행하여 올바른 필드 코드를 가져오세요 +6. **자동 필터 활용** - 선택형 필드는 자동으로 보고서 필터를 생성하므로 대화형 대시보드를 위해 `xField`로 사용하세요 diff --git a/ko/features/skills.mdx b/ko/features/skills.mdx index 0fea299..fcc2b0c 100644 --- a/ko/features/skills.mdx +++ b/ko/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "<表单名>" <字段JSON> \ # 양식 업데이트 openyida create-form update <修改JSON> -# 양식 Schema 가져오기 +# 양식 Schema 가져오기 (필드 ID 및 보고서 필드 코드 반환) openyida get-schema # 양식 구성 업데이트 diff --git a/pt/features/report.mdx b/pt/features/report.mdx index a53245b..320b88e 100644 --- a/pt/features/report.mdx +++ b/pt/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | Tabela dinâmica cruzada | Análise multidimensional | | **gauge** | Gráfico de medidor | Acompanhamento de progresso ou metas | | **funnel** | Gráfico de funil | Conversão por etapas | +| **radar** | Gráfico radar | Comparação multivariável | --- @@ -179,6 +180,99 @@ Definir `w` ou `h` como `0` é válido e será respeitado. Se omitido, os valore } ``` +### Indicador (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### Medidor + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### Gráfico radar + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## Códigos de campo para relatórios + +Ao referenciar campos de formulário nas definições de gráficos, a maioria dos tipos de campo usa seu ID de campo diretamente (ex: `textField_abc123`). No entanto, campos do tipo seleção — como `SelectField`, `RadioField`, `CheckboxField`, `EmployeeField` e `DepartmentSelectField` — requerem a adição do sufixo `_value` ao ID do campo. + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +Use `openyida get-schema` para obter o esquema do formulário e identificar os códigos de campo corretos para seus gráficos. + + + +Usar um ID de campo sem o sufixo `_value` para campos do tipo seleção resultará em dados vazios ou incorretos no gráfico. + + +--- + +## Formato de campo alternativo + +Em vez de usar `xField` e `yField` como strings, você pode usar um array `fields` para especificar múltiplas medidas com tipos de agregação individuais: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +Este formato é especialmente útil para gráficos combinados e gráficos radar que precisam exibir múltiplas métricas na mesma visualização. + +--- + +## Filtros + +Campos do tipo seleção (SelectField, RadioField, CheckboxField, etc.) geram automaticamente filtros no relatório. Quando um gráfico usa um campo do tipo seleção como `xField`, a interface do relatório exibe um menu suspenso de filtro, permitindo que os usuários filtrem os dados do gráfico interativamente. + +Nenhuma configuração adicional é necessária — os filtros são gerados com base no tipo de campo no esquema do formulário. + --- ## Funções de agregação @@ -190,6 +284,7 @@ Definir `w` ou `h` como `0` é válido e será respeitado. Se omitido, os valore | **count** | Contagem de registros | | **max** | Valor máximo | | **min** | Valor mínimo | +| **count_distinct** | Contagem de valores únicos | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## Validação de configuração + +Antes de criar um relatório, valide a configuração dos seus gráficos para evitar erros comuns: + +1. **Verifique os códigos de campo** — Execute `openyida get-schema` para verificar os IDs de campo e garantir que campos do tipo seleção incluem o sufixo `_value`. +2. **Verifique a fonte de dados** — Certifique-se de que `dataSource` ou `cubeCode` corresponde a um UUID de formulário válido no seu aplicativo. +3. **Valide os tipos de agregação** — Confirme que a função de agregação é compatível com o tipo de campo (ex: `sum` funciona apenas em campos numéricos). +4. **Teste com um único gráfico** — Comece com um gráfico para verificar a configuração antes de adicionar vários. + +--- + ## Melhores práticas 1. **Escolha o tipo de gráfico apropriado** - Gráficos de linhas para tendências, de barras para comparações, circulares para proporções 2. **Limite a quantidade de gráficos** - Mantenha 6 gráficos ou menos por relatório 3. **Inclua tabelas de dados** - Combine gráficos com tabelas para inspeção detalhada dos dados 4. **Configure tamanhos de página razoáveis** - Para tabelas de dados, use 10-20 linhas por página +5. **Use get-schema para descobrir campos** - Execute `openyida get-schema` para obter os códigos de campo corretos antes de construir as definições de gráficos +6. **Aproveite os filtros automáticos** - Campos do tipo seleção geram automaticamente filtros de relatório, use-os como `xField` para painéis interativos diff --git a/pt/features/skills.mdx b/pt/features/skills.mdx index 939750b..d1871a8 100644 --- a/pt/features/skills.mdx +++ b/pt/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "" \ # Atualizar formulário openyida create-form update -# Obter Schema do formulário +# Obter Schema do formulário (retorna IDs de campo e códigos de campo para relatórios) openyida get-schema # Atualizar configuração do formulário diff --git a/vi/features/report.mdx b/vi/features/report.mdx index 7bfe25b..436e1b1 100644 --- a/vi/features/report.mdx +++ b/vi/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | Bảng pivot chéo | Phân tích đa chiều | | **gauge** | Biểu đồ đồng hồ đo | Theo dõi tiến độ hoặc mục tiêu | | **funnel** | Biểu đồ phễu | Chuyển đổi theo giai đoạn | +| **radar** | Biểu đồ radar | So sánh đa biến | --- @@ -179,6 +180,99 @@ Bạn có thể kiểm soát chiều rộng và chiều cao của mỗi biểu } ``` +### Chỉ số (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### Đồng hồ + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### Biểu đồ radar + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## Mã trường trong báo cáo + +Khi tham chiếu các trường biểu mẫu trong định nghĩa biểu đồ báo cáo, hầu hết các loại trường sử dụng trực tiếp ID trường của chúng (ví dụ: `textField_abc123`). Tuy nhiên, các trường dạng chọn — như `SelectField`, `RadioField`, `CheckboxField`, `EmployeeField` và `DepartmentSelectField` — yêu cầu thêm hậu tố `_value` vào ID trường. + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +Sử dụng `openyida get-schema` để lấy cấu trúc biểu mẫu và xác định mã trường chính xác cho biểu đồ báo cáo của bạn. + + + +Sử dụng ID trường không có hậu tố `_value` cho các trường dạng chọn sẽ dẫn đến dữ liệu trống hoặc không chính xác trong biểu đồ. + + +--- + +## Định dạng trường thay thế + +Thay vì sử dụng `xField` và `yField` dưới dạng chuỗi, bạn có thể sử dụng mảng `fields` để chỉ định nhiều thước đo với các loại tổng hợp riêng lẻ: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +Định dạng này đặc biệt hữu ích cho biểu đồ kết hợp và biểu đồ radar cần hiển thị nhiều chỉ số trên cùng một trực quan hóa. + +--- + +## Bộ lọc + +Các trường dạng chọn (SelectField, RadioField, CheckboxField, v.v.) tự động tạo bộ lọc trong báo cáo. Khi biểu đồ sử dụng trường dạng chọn làm `xField`, giao diện báo cáo sẽ hiển thị menu thả xuống bộ lọc cho phép người dùng lọc dữ liệu biểu đồ một cách tương tác. + +Không cần cấu hình bổ sung — bộ lọc được tạo dựa trên loại trường trong cấu trúc biểu mẫu. + --- ## Hàm tổng hợp @@ -190,6 +284,7 @@ Bạn có thể kiểm soát chiều rộng và chiều cao của mỗi biểu | **count** | Số lượng bản ghi | | **max** | Giá trị lớn nhất | | **min** | Giá trị nhỏ nhất | +| **count_distinct** | Số lượng giá trị duy nhất | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## Xác thực cấu hình + +Trước khi tạo báo cáo, hãy xác thực cấu hình biểu đồ để tránh các lỗi phổ biến: + +1. **Kiểm tra mã trường** — Chạy `openyida get-schema` để xác minh ID trường và đảm bảo các trường dạng chọn bao gồm hậu tố `_value`. +2. **Xác minh nguồn dữ liệu** — Đảm bảo `dataSource` hoặc `cubeCode` khớp với UUID biểu mẫu hợp lệ trong ứng dụng. +3. **Xác thực loại tổng hợp** — Xác nhận hàm tổng hợp tương thích với loại trường (ví dụ: `sum` chỉ hoạt động trên trường số). +4. **Thử nghiệm với một biểu đồ** — Bắt đầu với một biểu đồ để xác minh cấu hình trước khi thêm nhiều biểu đồ. + +--- + ## Thực hành tốt nhất 1. **Chọn loại biểu đồ phù hợp** - Biểu đồ đường cho xu hướng, biểu đồ cột cho so sánh, biểu đồ tròn cho tỷ lệ 2. **Giới hạn số lượng biểu đồ** - Giữ mỗi báo cáo không quá 6 biểu đồ 3. **Bao gồm bảng dữ liệu** - Kết hợp biểu đồ với bảng để kiểm tra dữ liệu chi tiết 4. **Đặt kích thước trang hợp lý** - Với bảng dữ liệu, sử dụng 10-20 hàng mỗi trang +5. **Sử dụng get-schema để khám phá trường** - Chạy `openyida get-schema` để lấy mã trường chính xác trước khi xây dựng định nghĩa biểu đồ +6. **Tận dụng bộ lọc tự động** - Các trường dạng chọn tự động tạo bộ lọc báo cáo, sử dụng chúng làm `xField` để xây dựng bảng điều khiển tương tác diff --git a/vi/features/skills.mdx b/vi/features/skills.mdx index a1a8343..3660e52 100644 --- a/vi/features/skills.mdx +++ b/vi/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "" \ # Cập nhật biểu mẫu openyida create-form update -# Lấy Schema biểu mẫu +# Lấy Schema biểu mẫu (trả về ID trường và mã trường báo cáo) openyida get-schema # Cập nhật cấu hình biểu mẫu diff --git a/zh-Hant/features/report.mdx b/zh-Hant/features/report.mdx index 71b3ffc..ac7f66a 100644 --- a/zh-Hant/features/report.mdx +++ b/zh-Hant/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | 交叉透視表 | 多維分析 | | **gauge** | 儀表盤 | 進度或目標追蹤 | | **funnel** | 漏斗圖 | 階段轉化分析 | +| **radar** | 雷達圖 | 多變量對比 | --- @@ -179,6 +180,99 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ } ``` +### 指標卡 (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### 儀表盤 + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### 雷達圖 + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## 報表欄位編碼 + +在報表圖表定義中引用表單欄位時,大多數欄位類型直接使用其欄位 ID(如 `textField_abc123`)。但是,選擇類欄位——如 `SelectField`、`RadioField`、`CheckboxField`、`EmployeeField` 和 `DepartmentSelectField`——需要在欄位 ID 後追加 `_value` 後綴。 + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +使用 `openyida get-schema` 取得表單結構,確認報表圖表中的正確欄位編碼。 + + + +對選擇類欄位使用不帶 `_value` 後綴的欄位 ID 會導致圖表中資料為空或不正確。 + + +--- + +## 替代欄位格式 + +除了使用字串形式的 `xField` 和 `yField`,還可以使用 `fields` 陣列來指定多個度量及其各自的聚合類型: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +此格式特別適用於需要在同一視覺化中顯示多個指標的柱線混合圖和雷達圖。 + +--- + +## 篩選器 + +選擇類欄位(SelectField、RadioField、CheckboxField 等)會自動在報表中生成篩選器。當圖表使用選擇類欄位作為 `xField` 時,報表介面會顯示篩選下拉選單,允許使用者互動式地篩選圖表資料。 + +無需額外配置——篩選器根據表單結構中的欄位類型自動生成。 + --- ## 聚合函數 @@ -190,6 +284,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **count** | 計數 | | **max** | 最大值 | | **min** | 最小值 | +| **count_distinct** | 唯一值計數 | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## 配置驗證 + +在建立報表之前,驗證圖表配置以避免常見錯誤: + +1. **檢查欄位編碼** — 執行 `openyida get-schema` 驗證欄位 ID,確保選擇類欄位包含 `_value` 後綴。 +2. **驗證資料來源** — 確保 `dataSource` 或 `cubeCode` 與應用中的有效表單 UUID 相符。 +3. **驗證聚合類型** — 確認聚合函式與欄位類型相容(例如,`sum` 僅適用於數字欄位)。 +4. **先測試單個圖表** — 先使用一個圖表驗證配置,然後再新增多個圖表。 + +--- + ## 最佳實踐 1. **合理選擇圖表類型** - 趨勢用折線圖、對比用柱狀圖、佔比用餅圖 2. **控制圖表數量** - 單個報表建議不超過 6 個圖表 3. **使用數據表格** - 配合圖表展示詳細數據,方便查看原始值 4. **設置合適的分頁** - 數據表格建議每頁 10-20 條 +5. **使用 get-schema 發現欄位** - 在建構圖表定義之前執行 `openyida get-schema` 取得正確的欄位編碼 +6. **利用自動篩選器** - 選擇類欄位自動產生報表篩選器,將其用作 `xField` 可建構互動式儀表板 diff --git a/zh-Hant/features/skills.mdx b/zh-Hant/features/skills.mdx index 2fa1e7e..a4844cd 100644 --- a/zh-Hant/features/skills.mdx +++ b/zh-Hant/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "<表單名>" <字段JSON> \ # 更新表單 openyida create-form update <修改JSON> -# 獲取表單 Schema +# 獲取表單 Schema(返回欄位 ID 和報表欄位編碼) openyida get-schema # 更新表單配置 diff --git a/zh/features/report.mdx b/zh/features/report.mdx index f69a35e..8ed193b 100644 --- a/zh/features/report.mdx +++ b/zh/features/report.mdx @@ -96,6 +96,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **pivot** | 交叉透视表 | 多维分析 | | **gauge** | 仪表盘 | 进度或目标跟踪 | | **funnel** | 漏斗图 | 阶段转化分析 | +| **radar** | 雷达图 | 多变量对比 | --- @@ -179,6 +180,99 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ } ``` +### 指标卡 (KPI) + +```json +{ + "type": "indicator", + "title": "Total Revenue", + "cubeCode": "form_uuid", + "kpiField": "numberField_amount", + "aggregation": "sum" +} +``` + +### 仪表盘 + +```json +{ + "type": "gauge", + "title": "Completion Rate", + "cubeCode": "form_uuid", + "kpiField": "numberField_rate", + "aggregation": "avg" +} +``` + +### 雷达图 + +```json +{ + "type": "radar", + "title": "Performance Overview", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_score1", "aggregateType": "AVG" }, + { "fieldCode": "numberField_score2", "aggregateType": "AVG" } + ] +} +``` + +--- + +## 报表字段编码 + +在报表图表定义中引用表单字段时,大多数字段类型直接使用其字段 ID(如 `textField_abc123`)。但是,选择类字段——如 `SelectField`、`RadioField`、`CheckboxField`、`EmployeeField` 和 `DepartmentSelectField`——需要在字段 ID 后追加 `_value` 后缀。 + +| Field type | Field ID example | Report field code | +|------------|------------------|-------------------| +| TextField | textField_abc123 | textField_abc123 | +| NumberField | numberField_abc123 | numberField_abc123 | +| DateField | dateField_abc123 | dateField_abc123 | +| SelectField | selectField_abc123 | selectField_abc123_value | +| RadioField | radioField_abc123 | radioField_abc123_value | +| CheckboxField | checkboxField_abc123 | checkboxField_abc123_value | +| EmployeeField | employeeField_abc123 | employeeField_abc123_value | +| DepartmentSelectField | departmentSelectField_abc123 | departmentSelectField_abc123_value | + + +使用 `openyida get-schema` 获取表单结构,确认报表图表中的正确字段编码。 + + + +对选择类字段使用不带 `_value` 后缀的字段 ID 会导致图表中数据为空或不正确。 + + +--- + +## 替代字段格式 + +除了使用字符串形式的 `xField` 和 `yField`,还可以使用 `fields` 数组来指定多个度量及其各自的聚合类型: + +```json +{ + "type": "bar", + "title": "Multi-measure Chart", + "cubeCode": "form_uuid", + "xField": "selectField_category_value", + "yField": [ + { "fieldCode": "numberField_amount", "aggregateType": "SUM" }, + { "fieldCode": "numberField_count", "aggregateType": "COUNT" } + ] +} +``` + +此格式特别适用于需要在同一可视化中显示多个指标的柱线混合图和雷达图。 + +--- + +## 筛选器 + +选择类字段(SelectField、RadioField、CheckboxField 等)会自动在报表中生成筛选器。当图表使用选择类字段作为 `xField` 时,报表界面会显示筛选下拉菜单,允许用户交互式地筛选图表数据。 + +无需额外配置——筛选器根据表单结构中的字段类型自动生成。 + --- ## 聚合函数 @@ -190,6 +284,7 @@ openyida append-chart APP_XXXXXX REPORT_XXXXX '{ | **count** | 计数 | | **max** | 最大值 | | **min** | 最小值 | +| **count_distinct** | 唯一值计数 | --- @@ -248,9 +343,22 @@ openyida create-report APP_XXXXXX "Sales Analysis Report" ./sales-report-charts. --- +## 配置验证 + +在创建报表之前,验证图表配置以避免常见错误: + +1. **检查字段编码** — 运行 `openyida get-schema` 验证字段 ID,确保选择类字段包含 `_value` 后缀。 +2. **验证数据源** — 确保 `dataSource` 或 `cubeCode` 与应用中的有效表单 UUID 匹配。 +3. **验证聚合类型** — 确认聚合函数与字段类型兼容(例如,`sum` 仅适用于数字字段)。 +4. **先测试单个图表** — 先使用一个图表验证配置,然后再添加多个图表。 + +--- + ## 最佳实践 1. **合理选择图表类型** - 趋势用折线图、对比用柱状图、占比用饼图 2. **控制图表数量** - 单个报表建议不超过 6 个图表 3. **使用数据表格** - 配合图表展示详细数据,方便查看原始值 4. **设置合适的分页** - 数据表格建议每页 10-20 条 +5. **使用 get-schema 发现字段** - 在构建图表定义之前运行 `openyida get-schema` 获取正确的字段编码 +6. **利用自动筛选器** - 选择类字段自动生成报表筛选器,将其用作 `xField` 可构建交互式仪表板 diff --git a/zh/features/skills.mdx b/zh/features/skills.mdx index 69d3b5a..c4ba6c6 100644 --- a/zh/features/skills.mdx +++ b/zh/features/skills.mdx @@ -69,7 +69,7 @@ openyida create-form create "<表单名>" <字段JSON> \ # 更新表单 openyida create-form update <修改JSON> -# 获取表单 Schema +# 获取表单 Schema(返回字段 ID 和报表字段编码) openyida get-schema # 更新表单配置