Skip to main content

PivotGridFieldBase.KPIGraphic Property

Gets or sets a graphic set used to indicate KPI values.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.PivotGrid.v22.2.Core.dll

NuGet Packages: DevExpress.PivotGrid.Core, DevExpress.Win.Dashboard.Design

Declaration

[DefaultValue(PivotKPIGraphic.ServerDefined)]
public PivotKPIGraphic KPIGraphic { get; set; }

Property Value

Type Default Description
PivotKPIGraphic ServerDefined

A PivotKPIGraphic enumeration value that specifies the graphic set used to indicate KPI values.

Available values:

Show 16 items
Name Description
None

No image is displayed.

ServerDefined

The KPI graphic type is defined by the server.

Shapes

KPIGraphic_Shapes_-1KPIGraphic_Shapes_0KPIGraphic_Shapes_1

TrafficLights

KPIGraphic_TrafficLights_-1KPIGraphic_TrafficLights_0KPIGraphic_TrafficLights_1

RoadSigns

KPIGraphic_RoadSigns_-1KPIGraphic_RoadSigns_0KPIGraphic_RoadSigns_1

Gauge

KPIGraphic_Gauge_-1KPIGraphic_Gauge_0KPIGraphic_Gauge_1

ReversedGauge

KPIGraphic_ReversedGauge_-1KPIGraphic_ReversedGauge_0KPIGraphic_ReversedGauge_1

Thermometer

KPIGraphic_Thermometer_-1KPIGraphic_Thermometer_0KPIGraphic_Thermometer_1

ReversedThermometer

KPIGraphic_ReversedThermometer_-1KPIGraphic_ReversedThermometer_0KPIGraphic_ReversedThermometer_1

Cylinder

KPIGraphic_Cylinder_-1KPIGraphic_Cylinder_0KPIGraphic_Cylinder_1

ReversedCylinder

KPIGraphic_ReversedCylinder_-1KPIGraphic_ReversedCylinder_0KPIGraphic_ReversedCylinder_1

Faces

KPIGraphic_Faces_-1KPIGraphic_Faces_0KPIGraphic_Faces_1

VarianceArrow

KPIGraphic_VarianceArrow_-1KPIGraphic_VarianceArrow_0KPIGraphic_VarianceArrow_1

StandardArrow

KPIGraphic_StandardArrow_-1KPIGraphic_StandardArrow_0KPIGraphic_StandardArrow_1

StatusArrow

KPIGraphic_StatusArrow_-1KPIGraphic_StatusArrow_0KPIGraphic_StatusArrow_1

ReversedStatusArrow

KPIGraphic_ReversedStatusArrow_-1KPIGraphic_ReversedStatusArrow_0KPIGraphic_ReversedStatusArrow_1

Remarks

KPI supports graphic representation for its Status and Trend values. OLAP supports 12 graphic sets such as shapes, smiley faces, traffic lights, etc. Use the KPIGraphic property to specify the graphic set.

If the KPIGraphic property is not set to PivotKPIGraphic.ServerDefined, KPI graphics can be displayed for table data sources. In this instance, valid KPI values are -1 (bad), 0 (neutral), and 1 (good).

Refer to the following topic for more information: Key Performance Indicators (KPIs).

Example

The following example shows how to display KPI graphics in the Pivot Grid bound to the Northwind database. The image below illustrates the resulting UI.

ex-WF-PivotGrid-RegularDataSorceKPI

View Example: Pivot Grid for WinForms - Display KPI Graphics

To display KPI graphics, create a Pivot Grid field and bind it to the following expression:

(Iif(Sum([{0}])<100000,-1,Iif(Sum([{0}])<150000,0,1)))", fieldExtendedPrice.ExpressionFieldName)

The field values depend on the Extended Price field values. If the Extended Price field value is less than 100000, the field value is -1. If the Extended Price field value is less than 150000, the field value is 0. In other cases, the field value is 1.

Use the PivotGridFieldBase.KPIGraphic property to specify a graphic set used to visualize field values.

using System;
using System.Windows.Forms;
using DevExpress.XtraPivotGrid;

namespace WindowsFormsApp_RegularDataSourceKPI {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e) {
            // Binds the Pivot Grid to data.
            this.salesPersonTableAdapter.Fill(this.nwindDataSet.SalesPerson);
            // Creates a new "Status" field to show KPI values.
            PivotGridField KPIField = pivotGridControl1.Fields.Add();
            KPIField.Area = PivotArea.DataArea;
            KPIField.Caption = "Status";
            // Sets a column's data binding and specifies an expression.
            KPIField.DataBinding = new ExpressionDataBinding(
                string.Format("(Iif(Sum([{0}])<100000,-1,Iif(Sum([{0}])<150000,0,1)))", 
                fieldExtendedPrice.ExpressionFieldName));
            // Sets the Data Header Area within which the "Status" Field can be positioned.
            KPIField.AllowedAreas = DevExpress.XtraPivotGrid.PivotGridAllowedAreas.DataArea;
            // Specifies a graphic set used to indicate KPI values.
            KPIField.KPIGraphic = PivotKPIGraphic.Faces;
        }
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the KPIGraphic property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also