Class IgxNumberSummaryOperand

Hierarchy

Index

Constructors

Methods

Constructors

constructor

Methods

operate

  • operate(data?: any[], allData?: any[], fieldName?: string): IgxSummaryResult[]
  • Executes the static methods and returns IgxSummaryResult[].

    interface IgxSummaryResult {
      key: string;
      label: string;
      summaryResult: any;
    }
    

    Can be overridden in the inherited classes to provide customization for the summary.

    class CustomNumberSummary extends IgxNumberSummaryOperand {
      constructor() {
        super();
      }
      public operate(data: any[], allData: any[], fieldName: string): IgxSummaryResult[] {
        const result = super.operate(data, allData, fieldName);
        result.push({
          key: "avg",
          label: "Avg",
          summaryResult: IgxNumberSummaryOperand.average(data)
        });
        result.push({
          key: 'mdn',
          label: 'Median',
          summaryResult: this.findMedian(data)
        });
        return result;
      }
    }
    this.grid.getColumnByName('ColumnName').summaries = CustomNumberSummary;
    
    @memberof

    IgxNumberSummaryOperand

    Parameters

    • data: any[] = []
    • allData: any[] = []
    • Optional fieldName: string

    Returns IgxSummaryResult[]

Static average

  • average(data: any[]): number
  • Returns the average numeric value in the data provided data records. If filtering is applied, returns the average numeric value in the filtered data records.

    IgxSummaryOperand.average(data);
    
    @memberof

    IgxNumberSummaryOperand

    Parameters

    • data: any[]

    Returns number

Static count

  • count(data: any[]): number

Static max

  • max(data: any[]): number

Static min

  • min(data: any[]): number

Static sum

  • sum(data: any[]): number