File tree Expand file tree Collapse file tree 2 files changed +39
-31
lines changed
TestsUpdateGroupsInSeriesAddedEvent
TestsUpdateTitlesInSeriesAddedEvent Expand file tree Collapse file tree 2 files changed +39
-31
lines changed Original file line number Diff line number Diff line change @@ -7,22 +7,26 @@ export class TestsUpdateGrpupsInSeriesAddedEvent
77{
88 //begin eventHandler
99 groupIndex : number = 0 ;
10- public testsUpdateGroupsInSeriesAddedEvent ( sender : any , args : IgcChartSeriesEventArgs ) : void
11- {
12- const o = CodeGenHelper . findByName < any > ( "SeriesAddedGroups" ) ;
13- const obj = JSON . parse ( o . value . toString ( ) ) ;
14- const updateAnnotations : boolean = obj . includeAnnotations ;
15- const groups : string [ ] = obj . names ;
16-
17- if ( args . series . isAnnotationLayer ) {
18- return ;
19- }
10+ updateAnnotations : boolean = false ;
11+ groups : string [ ] = null ;
12+ public testsUpdateGroupsInSeriesAddedEvent ( sender : any , args : IgrChartSeriesEventArgs ) : void
13+ {
14+ if ( this . groups == null ) {
15+ const o = CodeGenHelper . findByName < object > ( "SeriesAddedGroups" ) ;
16+ const obj = JSON . parse ( o [ "value" ] ) ;
17+ this . updateAnnotations = obj . includeAnnotations ;
18+ this . groups = obj . names ;
19+ }
2020
21- if ( this . groupIndex >= groups . length )
22- this . groupIndex = 0 ;
23- if ( groups . includes ( args . series . dataLegendGroup ) )
24- return ; // already set
25- args . series . dataLegendGroup = groups [ this . groupIndex ++ ] ;
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 ++ ] ;
2630 }
2731 //end eventHandler
2832}
Original file line number Diff line number Diff line change @@ -6,27 +6,31 @@ import { IgcChartSeriesEventArgs } from 'igniteui-webcomponents-charts';
66export 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 . value . 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}
You can’t perform that action at this time.
0 commit comments