Skip to main content

SingleDataChart

Purpose

The SingleDataChart ViewTemplate visualizes one-dimensional data as a chart. It is used for scenarios in which each X-axis entry corresponds to exactly one Y-axis value, for example in pie, donut, funnel, or pyramid charts.

SingleDataChart Figure: SingleDataChart displaying one-dimensional chart data.

Behavior

The ViewTemplate typically reads its data through a JDitoRecordContainer. Drill-downs can be implemented through parentField, which allows child chart entries to be linked to parent entries.

Supported chart types include:

  • DONUT
  • FUNNEL
  • PIE
  • PYRAMID

Configuration

Typical properties include:

PropertyDescription
entityFieldDefines the source entity, often #ENTITY.
informationFieldDefines the chart labels.
xAxisDefines the categorical dimension.
yAxisDefines the value dimension.
parentFieldDefines drill-down relationships.
chartTypeDefines the chart type.
colorFieldOptionally defines the chart colors, typically through neon. constants.
showDataLabelValuesControls whether numeric labels are shown.
dataLabelPositionInsideControls whether labels are shown inside data points.

Example colorField logic:

result.string(neon.USER_COLOR_1);

Example usage

An example is the ViewTemplate SingleDataChart in CampaignCostChart_view.

In the ADITO client, it is shown under Marketing > Campaign in the Overview area of CampaignMain_view, where it displays a donut chart for fixed and variable costs. pie_contact_dist Figure: Example of a pie chart based on contact distribution. pie_gender_dist Figure: Example of a drill-down into a chart segment.

Implementation hints

A common implementation pattern is to create records in the contentProcess that contain values for UID, X, Y, INFORMATION, and optionally PARENTID. Parent entries must be added before their child entries so that drill-down relationships can be resolved correctly.