Example #1
0
        private void InitializePivotChart()
        {
            // Adding ItemSource to the Control
            this.pivotChart1.ItemSource = ProductSalesData.GetSalesData();

            // Adding PivotAxis to the Control
            this.pivotChart1.PivotAxis.Add(new PivotItem {
                FieldMappingName = "Product", TotalHeader = "Total"
            });
            this.pivotChart1.PivotAxis.Add(new PivotItem {
                FieldMappingName = "Date", TotalHeader = "Total"
            });

            // Adding PivotLegend to the Control
            this.pivotChart1.PivotLegend.Add(new PivotItem {
                FieldMappingName = "Country", TotalHeader = "Total"
            });

            // Adding PivotCalculations to the Control
            this.pivotChart1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "Quantity", Format = "#,##0"
            });
            this.pivotChart1.Skins                      = Skins.Metro;
            this.pivotChart1.ShowLegend                 = true;
            this.pivotChart1.AllowDrillDown             = true;
            this.pivotChart1.AxisFieldSection.Visible   = true;
            this.pivotChart1.LegendFieldSection.Visible = true;
            this.pivotChart1.FilterFieldSection.Visible = true;
            this.pivotChart1.ValueFieldSection.Visible  = true;
            this.pivotTableFieldList1.AssociateWith(this.pivotChart1);
        }
Example #2
0
        /// <summary>
        /// The Grid settings Customization
        /// </summary>
        private void InitializePivotGrid()
        {
            // Adding ItemSource to the Control
            pivotGridControl1.ItemSource = ProductSalesData.GetSalesData();

            // Adding PivotRows to the Control
            pivotGridControl1.PivotRows.Add(new PivotItem {
                FieldMappingName = "Product", TotalHeader = "Total"
            });

            pivotGridControl1.PivotRows.Add(new PivotItem {
                FieldMappingName = "Date", TotalHeader = "Total"
            });

            // Adding PivotColumns to the Control
            pivotGridControl1.PivotColumns.Add(new PivotItem {
                FieldMappingName = "Country", TotalHeader = "Total"
            });

            pivotGridControl1.PivotColumns.Add(new PivotItem {
                FieldMappingName = "State", TotalHeader = "Total"
            });

            // Adding PivotCalculations to the Control
            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "Amount", Format = "$ #,##0.00", SummaryType = SummaryType.DoubleTotalSum
            });

            pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo {
                FieldName = "Quantity", Format = "#,##0"
            });

            //tab key navigation set as false to move the next control
            pivotGridControl1.TableControl.WantTabKey = false;

            pivotGridControl1.ShowPivotTableFieldList = true;
            pivotGridControl1.ShowGroupBar            = true;
        }