kpiTrendTemplate String|Function

The template which renders the content of the KPI Trend value. By default renders "increase", "decrease" and "equal" status icons.

The fields which can be used in the template are:

  • columnTuple - the tuple of the corresponding column header cell
  • rowTuple - the tuple of the corresponding row header cell
  • measure - the value of the data cell measure
  • dataItem - the data item itself

Example - specify a custom template for the KPI Trend measure

<div id="pivotgrid"></div>

<script>
    $("#pivotgrid").kendoPivotGridV2({
        kpiTrendTemplate: ({ dataItem }) => `${dataItem.value !== 0 ? "<em>Increase/Decrease</em>" : "<strong>Equal</strong>"}`,
        dataSource: {
            type: "xmla",
            columns: [{ name: "[Date].[Calendar]", expand: true } ],
            rows: [{ name: "[Geography].[City]" }], 
            measures: [{ name: "[Measures].[Internet Revenue Trend]", type: "trend"}],
            transport: {
                connection: {
                    catalog: "Adventure Works DW 2008R2",
                    cube: "Adventure Works"
                },
                read: {
                    url: "https://demos.telerik.com/olap/msmdpump.dll",
                    dataType: "text",
                    contentType: "text/xml",
                    type: "POST"
                }
            },
            schema: {
                type: "xmla"
            }
        }
    });
</script>
In this article