Skip to content

Commit b6650c3

Browse files
committed
web fixes
1 parent 7ab9844 commit b6650c3

File tree

7 files changed

+44
-32
lines changed
  • code-gen-library
    • FormatDateLabelAsDateAndTime
    • FormatDateLabelAsDate
    • FormatDateLabelAsShortDate
    • FormatDateLabelAsTime
    • FormatLabelAsTest
    • TestsUpdateGroupsInSeriesAddedEvent
    • TestsUpdateTitlesInSeriesAddedEvent

7 files changed

+44
-32
lines changed

code-gen-library/FormatDateLabelAsDate/Web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class FormatDateLabelAsDate
66
{
77
//begin eventHandler
88
//WPF: Infragistics.Controls.Charts.AxisFormatLabelEventHandler
9-
public formatDateLabelAsDate(sender: any, item: any): string
9+
public formatDateLabelAsDate(item: any): string
1010
{
1111

1212
let d: Date;

code-gen-library/FormatDateLabelAsDateAndTime/Web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using System.Collections;
66
export class FormatDateLabelAsDateAndTime
77
{
88
//begin eventHandler
9-
public formatDateLabelAsDateAndTime( sender:any, item:any):string
9+
public formatDateLabelAsDateAndTime(item:any):string
1010
{
1111

1212
let d: Date;

code-gen-library/FormatDateLabelAsShortDate/Web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class FormatDateLabelAsShortDate
55
{
66
//begin eventHandler
77
//WPF: Infragistics.Controls.Charts.AxisFormatLabelEventHandler
8-
public FormatDateLabelAsShortDate(sender: any, item: any): string
8+
public FormatDateLabelAsShortDate(item: any): string
99
{
1010

1111
let d: Date;

code-gen-library/FormatDateLabelAsTime/Web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class FormatDateLabelAsTime
66
{
77
//begin eventHandler
88
//WPF: Infragistics.Controls.Charts.AxisFormatLabelEventHandler
9-
public formatDateLabelAsTime(sender: any, item: any): string
9+
public formatDateLabelAsTime(item: any): string
1010
{
1111

1212
let d: Date;

code-gen-library/FormatLabelAsTest/Web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class FormatLabelAsTest
55
{
66
//begin eventHandler
77
//WPF: Infragistics.Controls.Charts.AxisFormatLabelEventHandler
8-
public formatLabelAsTest(sender:any,item: any): string
8+
public formatLabelAsTest(item: any): string
99
{
1010
return "TEST";
1111
}

code-gen-library/TestsUpdateGroupsInSeriesAddedEvent/Web.ts

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,26 @@ export class TestsUpdateGrpupsInSeriesAddedEvent
77
{
88
//begin eventHandler
99
groupIndex: number = 0;
10-
public testsUpdateGroupsInSeriesAddedEvent(sender: any,args: IgcChartSeriesEventArgs): void
11-
{
10+
updateAnnotations: boolean = false;
11+
groups: string[] = null;
12+
public testsUpdateGroupsInSeriesAddedEvent(sender: any,args: IgrChartSeriesEventArgs): void
13+
{
14+
if (this.groups == null){
1215
const o = CodeGenHelper.findByName<object>("SeriesAddedGroups");
13-
const obj = JSON.parse(o.toString());
14-
const updateAnnotations: boolean = obj.includeAnnotations;
15-
const groups: string[] = obj.names;
16-
17-
if (this.groupIndex >= groups.length)
18-
this.groupIndex = 0;
19-
if (groups.includes(args.series.dataLegendGroup))
20-
return; // already set
21-
args.series.dataLegendGroup = groups[this.groupIndex++];
16+
const obj = JSON.parse(o["value"]);
17+
this.updateAnnotations = obj.includeAnnotations;
18+
this.groups = obj.names;
19+
}
20+
21+
if (args.series.isAnnotationLayer && !this.updateAnnotations) {
22+
return;
23+
}
24+
25+
if (this.groupIndex >= this.groups.length)
26+
this.groupIndex = 0;
27+
if (this.groups.includes(args.series.dataLegendGroup))
28+
return; // already set
29+
args.series.dataLegendGroup = this.groups[this.groupIndex++];
2230
}
2331
//end eventHandler
2432
}

code-gen-library/TestsUpdateTitlesInSeriesAddedEvent/Web.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@ import { IgcChartSeriesEventArgs } from 'igniteui-webcomponents-charts';
66
export class TestsUpdateTitlesInSeriesAddedEvent {
77
//begin eventHandler
88
titleIndex:number = 0;
9-
public testsUpdateTitlesInSeriesAddedEvent(sender: any,args: IgcChartSeriesEventArgs): void {
10-
const o = CodeGenHelper.findByName<any>("SeriesAddedTitles");
11-
const obj = JSON.parse(o.toString());
12-
13-
const updateAnnotations: boolean = obj.includeAnnotations;
14-
const names: string[] = obj.names;
15-
16-
if (args.series.isAnnotationLayer && !updateAnnotations) {
9+
updateAnnotations: boolean = false;
10+
names: string[] = null;
11+
public testsUpdateTitlesInSeriesAddedEvent(sender: any,args: IgrChartSeriesEventArgs): void {
12+
if (this.names == null){
13+
const o = CodeGenHelper.findByName<any>("SeriesAddedTitles");
14+
const obj = JSON.parse(o["value"]);
15+
16+
this.updateAnnotations = obj.includeAnnotations;
17+
this.names = obj.names;
18+
}
19+
20+
if (args.series.isAnnotationLayer && !this.updateAnnotations) {
1721
return;
1822
}
19-
20-
if (this.titleIndex >= names.length) {
23+
24+
if (this.titleIndex >= this.names.length) {
2125
this.titleIndex = 0;
2226
}
23-
24-
if (names.includes(args.series.title)) {
27+
28+
if (this.names.includes(args.series.title)) {
2529
return; // already set
2630
}
27-
28-
args.series.title = names[this.titleIndex++];
29-
30-
}
31+
32+
args.series.title = this.names[this.titleIndex++];
33+
34+
}
3135
//end eventHandler
3236
}

0 commit comments

Comments
 (0)