Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,6 @@
primitiveValue="Country"
(changed)="this.editorChangeUpdateInitialGroups($event)">
</igx-property-editor-property-description>
<igx-property-editor-property-description
propertyPath="InitialSummariesHandler"
name="InitialSummaries"
#initialSummaries
label="Initial Summaries"
valueType="EnumValue"
shouldOverrideDefaultEditor="true"
primitiveValue="Sum(Sales) as Sales"
(changed)="this.editorChangeUpdateInitialSummaries($event)">
</igx-property-editor-property-description>
<igx-property-editor-property-description
propertyPath="GroupSortsHandler"
name="GroupSorts"
#groupSorts
label="Sort Groups"
valueType="EnumValue"
shouldOverrideDefaultEditor="true"
primitiveValue="Sales Desc"
(changed)="this.editorChangeUpdateGroupSorts($event)">
</igx-property-editor-property-description>
</igx-property-editor-panel>
</div>
<div class="legend-title">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AfterViewInit, Component, ViewChild, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { ComponentRenderer, PropertyEditorPanelDescriptionModule, LegendDescriptionModule, CategoryChartDescriptionModule } from 'igniteui-angular-core';
import { SalesData } from './SalesData';
import { IgxPropertyEditorPanelComponent, IgxPropertyEditorPropertyDescriptionChangedEventArgs, IgxPropertyEditorPropertyDescriptionComponent } from 'igniteui-angular-layouts';
import { IgxPropertyEditorPanelComponent, PropertyEditorValueType, IgxPropertyEditorPropertyDescriptionChangedEventArgs, IgxPropertyEditorPropertyDescriptionComponent } from 'igniteui-angular-layouts';
import { IgxCategoryChartComponent, MarkerType, MarkerType_$type } from 'igniteui-angular-charts';
import { EnumUtil } from 'igniteui-angular-core';

Expand All @@ -23,10 +23,6 @@ export class AppComponent implements AfterViewInit
private editor: IgxPropertyEditorPanelComponent
@ViewChild("initialGroups", { static: true } )
private initialGroups: IgxPropertyEditorPropertyDescriptionComponent
@ViewChild("initialSummaries", { static: true } )
private initialSummaries: IgxPropertyEditorPropertyDescriptionComponent
@ViewChild("groupSorts", { static: true } )
private groupSorts: IgxPropertyEditorPropertyDescriptionComponent
@ViewChild("chart", { static: true } )
private chart: IgxCategoryChartComponent
private _salesData: SalesData = null;
Expand Down Expand Up @@ -62,33 +58,44 @@ export class AppComponent implements AfterViewInit
public propertyEditorInitAggregationsOnViewInit(): void {

var editor = this.editor;
var initialSummaries = editor.actualProperties.filter((p) => p.label == "Initial Summaries")[0];
initialSummaries.dropDownNames = ["Sum(Sales) as Sales", "Avg(Sales) as Sales", "Min(Sales) as Sales", "Max(Sales) as Sales", "Count(Sales) as Sales" ];
initialSummaries.dropDownValues = ["Sum(Sales) as Sales", "Avg(Sales) as Sales", "Min(Sales) as Sales", "Max(Sales) as Sales", "Count(Sales) as Sales" ];
var initialSummariesDropdown = new IgxPropertyEditorPropertyDescriptionComponent();
var sortGroupsDropdown = new IgxPropertyEditorPropertyDescriptionComponent();

var groupSorts = editor.actualProperties.filter((p) => p.label == "Sort Groups")[0];
groupSorts.dropDownNames = ["Sales Desc", "Sales Asc"];
groupSorts.dropDownValues = ["Sales Desc", "Sales Asc"];
}
initialSummariesDropdown.label = "Initial Summaries";
initialSummariesDropdown.valueType = PropertyEditorValueType.EnumValue;
initialSummariesDropdown.shouldOverrideDefaultEditor = true;
initialSummariesDropdown.dropDownNames = ["Sum(Sales) as Sales", "Avg(Sales) as Sales", "Min(Sales) as Sales", "Max(Sales) as Sales", "Count(Sales) as Sales" ];
initialSummariesDropdown.dropDownValues = ["Sum(Sales) as Sales", "Avg(Sales) as Sales", "Min(Sales) as Sales", "Max(Sales) as Sales", "Count(Sales) as Sales" ];

public editorChangeUpdateInitialGroups({ sender, args }: { sender: any, args: IgxPropertyEditorPropertyDescriptionChangedEventArgs }): void {
sortGroupsDropdown.label = "Sort Groups"
sortGroupsDropdown.valueType = PropertyEditorValueType.EnumValue;
sortGroupsDropdown.shouldOverrideDefaultEditor = true;
sortGroupsDropdown.dropDownNames = ["Sales Asc", "Sales Desc"];
sortGroupsDropdown.dropDownValues = ["Sales Asc","Sales Desc"];

var chart = this.chart;
var intialGroupVal = args.newValue.toString();
chart.initialGroups = intialGroupVal;
}
editor.properties.add(initialSummariesDropdown);
editor.properties.add(sortGroupsDropdown);

public editorChangeUpdateInitialSummaries({ sender, args }: { sender: any, args: IgxPropertyEditorPropertyDescriptionChangedEventArgs }): void {
initialSummariesDropdown.changed.subscribe((event: { sender: any, args: IgxPropertyEditorPropertyDescriptionChangedEventArgs }) => {

var chart = this.chart;
var intialSummaryVal = args.newValue.toString();
chart.initialSummaries = intialSummaryVal;
var chart = this.chart;
var intialSummaryVal = event.args.newValue.toString();
chart.initialSummaries = intialSummaryVal;
});

sortGroupsDropdown.changed.subscribe((event: { sender: any, args: IgxPropertyEditorPropertyDescriptionChangedEventArgs }) => {

var chart = this.chart;
var groupSortsVal = event.args.newValue.toString();
chart.groupSorts = groupSortsVal;
});
}

public editorChangeUpdateGroupSorts({ sender, args }: { sender: any, args: IgxPropertyEditorPropertyDescriptionChangedEventArgs }): void {
public editorChangeUpdateInitialGroups({ sender, args }: { sender: any, args: IgxPropertyEditorPropertyDescriptionChangedEventArgs }): void {

var chart = this.chart;
var groupSortsVal = args.newValue.toString();
chart.groupSorts = groupSortsVal;
var intialGroupVal = args.newValue.toString();
chart.initialGroups = intialGroupVal;
}

}
Expand Down