sisense.com
✅ You are viewing documentation for the latest version of Compose SDK.
Version:

Interface KpiChartDataOptions

Configuration for how to query aggregate data and assign data to a KPI chart.

Example

<KpiChart
  dataSet={DM.DataSource}
  dataOptions={{
    value: measureFactory.sum(DM.Commerce.Revenue),
    category: DM.Commerce.Date.Months,
    comparison: { type: 'previous-period' },
  }}
/>

Properties

category

category?: Column | StyledColumn

Sets the card's category (typically a date dimension): enables the sparkline, the current-period caption, the 'previous-period' comparison, and the valueMode semantics. Granularity comes from the column.

A StyledColumn wrapper's dateFormat formats every place the card displays the category value — the period caption and the sparkline tooltip.

A category that isn't a date is fully supported and simply has nothing to format: the caption and the sparkline tooltip name each bucket by its own text ('FEMALE') instead of a formatted date, the sparkline places its points in bucket order, and a 'previous-period' comparison — against the previous bucket, whatever it is — drops the granularity from its label ('vs prior period' rather than 'vs prior month').

Example

category: DM.Commerce.Date.Months

Example

category: { column: DM.Commerce.Date.Months, dateFormat: 'MM/yyyy' }

comparison

comparison?: KpiComparison

Configures what the headline is compared against.

Example

comparison: { type: 'target', target: 10000 }

value

value: CalculatedMeasureColumn | MeasureColumn | StyledMeasureColumn

Primary measure — the headline KPI value. Conditional coloring via color on the styled measure.

Setting treatNullDataAsZeros on the styled measure draws the sparkline's missing values as zero: a null value, and for a date category every date bucket between the first and the last one with no row. The line and area then run without gaps. The headline and its comparison are unaffected.

Example

value: { column: measureFactory.sum(DM.Commerce.Revenue), treatNullDataAsZeros: true }

valueMode

valueMode?: KpiValueMode

Selects which number is the headline when category is set.

Example

valueMode: 'total' // aggregate over the whole period instead of the last category bucket

Default

'last'
Last Updated: