22 AfterViewInit ,
33 Component ,
44 ViewEncapsulation ,
5- ViewChild ,
5+ viewChild ,
66 } from '@angular/core' ;
77 import { IgxButtonDirective , IgxLayoutDirective } from '<%=igxPackage%>' ;
88 import {
@@ -19,42 +19,41 @@ import {
1919 imports : [ IgxLayoutDirective , IgxButtonDirective , IgxBulletGraphCoreModule ]
2020} )
2121export class < %= ClassName % > implements AfterViewInit {
22- @ViewChild ( 'bulletGraph' , { static : true } )
23- public bulletGraph ! : IgxBulletGraphComponent ;
22+ public bulletGraph = viewChild . required < IgxBulletGraphComponent > ( 'bulletGraph' ) ;
2423
2524 public ngAfterViewInit ( ) : void {
2625 // enabling animation duration (in milliseconds)
27- this . bulletGraph . transitionDuration = 500 ;
26+ this . bulletGraph ( ) . transitionDuration = 500 ;
2827 this . AnimateToGauge3 ( ) ;
2928 }
3029
3130 public AnimateToGauge3 ( ) : void {
32- this . bulletGraph . minimumValue = 0 ;
33- this . bulletGraph . maximumValue = 120 ;
34- this . bulletGraph . value = 70 ;
35- this . bulletGraph . interval = 10 ;
31+ this . bulletGraph ( ) . minimumValue = 0 ;
32+ this . bulletGraph ( ) . maximumValue = 120 ;
33+ this . bulletGraph ( ) . value = 70 ;
34+ this . bulletGraph ( ) . interval = 10 ;
3635
3736 // setting appearance of labels
38- this . bulletGraph . labelInterval = 10 ;
39- this . bulletGraph . labelExtent = 0.02 ;
37+ this . bulletGraph ( ) . labelInterval = 10 ;
38+ this . bulletGraph ( ) . labelExtent = 0.02 ;
4039
4140 // setting custom appearance of performance bar
42- this . bulletGraph . valueInnerExtent = 0.5 ;
43- this . bulletGraph . valueOuterExtent = 0.7 ;
44- this . bulletGraph . valueBrush = '#000000' ;
41+ this . bulletGraph ( ) . valueInnerExtent = 0.5 ;
42+ this . bulletGraph ( ) . valueOuterExtent = 0.7 ;
43+ this . bulletGraph ( ) . valueBrush = '#000000' ;
4544
4645 // setting custom appearance of target bar
47- this . bulletGraph . targetValueBrush = '#000000' ;
48- this . bulletGraph . targetValueBreadth = 10 ;
49- this . bulletGraph . targetValue = 90 ;
46+ this . bulletGraph ( ) . targetValueBrush = '#000000' ;
47+ this . bulletGraph ( ) . targetValueBreadth = 10 ;
48+ this . bulletGraph ( ) . targetValue = 90 ;
5049
5150 // setting appearance of major/minor ticks
52- this . bulletGraph . minorTickCount = 5 ;
53- this . bulletGraph . minorTickEndExtent = 0.10 ;
54- this . bulletGraph . minorTickStartExtent = 0.20 ;
55- this . bulletGraph . tickStartExtent = 0.20 ;
56- this . bulletGraph . tickEndExtent = 0.05 ;
57- this . bulletGraph . tickStrokeThickness = 2 ;
51+ this . bulletGraph ( ) . minorTickCount = 5 ;
52+ this . bulletGraph ( ) . minorTickEndExtent = 0.10 ;
53+ this . bulletGraph ( ) . minorTickStartExtent = 0.20 ;
54+ this . bulletGraph ( ) . tickStartExtent = 0.20 ;
55+ this . bulletGraph ( ) . tickEndExtent = 0.05 ;
56+ this . bulletGraph ( ) . tickStrokeThickness = 2 ;
5857
5958 // setting custom gauge ranges
6059 const range1 = new IgxLinearGraphRangeComponent ( ) ;
@@ -67,64 +66,64 @@ export class <%=ClassName%> implements AfterViewInit {
6766 range3 . startValue = 80 ;
6867 range3 . endValue = 120 ;
6968
70- this . bulletGraph . rangeBrushes = [ '#FF9800' , '#F96232' , '#C62828' ] ;
71- this . bulletGraph . rangeOutlines = [ '#FF9800' , '#F96232' , '#C62828' ] ;
72- this . bulletGraph . ranges . clear ( ) ;
73- this . bulletGraph . ranges . add ( range1 ) ;
74- this . bulletGraph . ranges . add ( range2 ) ;
75- this . bulletGraph . ranges . add ( range3 ) ;
69+ this . bulletGraph ( ) . rangeBrushes = [ '#FF9800' , '#F96232' , '#C62828' ] ;
70+ this . bulletGraph ( ) . rangeOutlines = [ '#FF9800' , '#F96232' , '#C62828' ] ;
71+ this . bulletGraph ( ) . ranges . clear ( ) ;
72+ this . bulletGraph ( ) . ranges . add ( range1 ) ;
73+ this . bulletGraph ( ) . ranges . add ( range2 ) ;
74+ this . bulletGraph ( ) . ranges . add ( range3 ) ;
7675
7776 // setting extent of all gauge ranges
78- for ( let i = 0 ; i < this . bulletGraph . ranges . count ; i ++ ) {
79- const range = this . bulletGraph . ranges . item ( i ) ;
77+ for ( let i = 0 ; i < this . bulletGraph ( ) . ranges . count ; i ++ ) {
78+ const range = this . bulletGraph ( ) . ranges . item ( i ) ;
8079 range . innerStartExtent = 0.2 ;
8180 range . innerEndExtent = 0.2 ;
8281 range . outerStartExtent = 0.95 ;
8382 range . outerEndExtent = 0.95 ;
8483 }
8584
8685 // setting extent of gauge scale
87- this . bulletGraph . scaleBackgroundThickness = 0.5 ;
88- this . bulletGraph . scaleBackgroundBrush = '#dbdbdb' ;
89- this . bulletGraph . scaleBackgroundOutline = 'gray' ;
90- this . bulletGraph . scaleStartExtent = 0.05 ;
91- this . bulletGraph . scaleEndExtent = 0.95 ;
92- this . bulletGraph . scaleBackgroundThickness = 0 ;
86+ this . bulletGraph ( ) . scaleBackgroundThickness = 0.5 ;
87+ this . bulletGraph ( ) . scaleBackgroundBrush = '#dbdbdb' ;
88+ this . bulletGraph ( ) . scaleBackgroundOutline = 'gray' ;
89+ this . bulletGraph ( ) . scaleStartExtent = 0.05 ;
90+ this . bulletGraph ( ) . scaleEndExtent = 0.95 ;
91+ this . bulletGraph ( ) . scaleBackgroundThickness = 0 ;
9392
9493 // setting appearance of backing fill and outline
95- this . bulletGraph . backingBrush = '#f7f7f7' ;
96- this . bulletGraph . backingOutline = '#d1d1d1' ;
97- this . bulletGraph . backingStrokeThickness = 0 ;
94+ this . bulletGraph ( ) . backingBrush = '#f7f7f7' ;
95+ this . bulletGraph ( ) . backingOutline = '#d1d1d1' ;
96+ this . bulletGraph ( ) . backingStrokeThickness = 0 ;
9897
9998 }
10099
101100 public AnimateToGauge2 ( ) : void {
102- this . bulletGraph . minimumValue = 100 ;
103- this . bulletGraph . maximumValue = 200 ;
104- this . bulletGraph . value = 120 ;
105- this . bulletGraph . interval = 10 ;
101+ this . bulletGraph ( ) . minimumValue = 100 ;
102+ this . bulletGraph ( ) . maximumValue = 200 ;
103+ this . bulletGraph ( ) . value = 120 ;
104+ this . bulletGraph ( ) . interval = 10 ;
106105
107106 // setting appearance of labels
108- this . bulletGraph . labelInterval = 10 ;
109- this . bulletGraph . labelExtent = 0.02 ;
107+ this . bulletGraph ( ) . labelInterval = 10 ;
108+ this . bulletGraph ( ) . labelExtent = 0.02 ;
110109
111110 // setting custom appearance of performance bar
112- this . bulletGraph . valueInnerExtent = 0.5 ;
113- this . bulletGraph . valueOuterExtent = 0.7 ;
114- this . bulletGraph . valueBrush = '#000000' ;
111+ this . bulletGraph ( ) . valueInnerExtent = 0.5 ;
112+ this . bulletGraph ( ) . valueOuterExtent = 0.7 ;
113+ this . bulletGraph ( ) . valueBrush = '#000000' ;
115114
116115 // setting custom appearance of target bar
117- this . bulletGraph . targetValueBrush = '#000000' ;
118- this . bulletGraph . targetValueBreadth = 10 ;
119- this . bulletGraph . targetValue = 180 ;
116+ this . bulletGraph ( ) . targetValueBrush = '#000000' ;
117+ this . bulletGraph ( ) . targetValueBreadth = 10 ;
118+ this . bulletGraph ( ) . targetValue = 180 ;
120119
121120 // setting appearance of major/minor ticks
122- this . bulletGraph . minorTickCount = 5 ;
123- this . bulletGraph . minorTickEndExtent = 0.10 ;
124- this . bulletGraph . minorTickStartExtent = 0.20 ;
125- this . bulletGraph . tickStartExtent = 0.20 ;
126- this . bulletGraph . tickEndExtent = 0.05 ;
127- this . bulletGraph . tickStrokeThickness = 2 ;
121+ this . bulletGraph ( ) . minorTickCount = 5 ;
122+ this . bulletGraph ( ) . minorTickEndExtent = 0.10 ;
123+ this . bulletGraph ( ) . minorTickStartExtent = 0.20 ;
124+ this . bulletGraph ( ) . tickStartExtent = 0.20 ;
125+ this . bulletGraph ( ) . tickEndExtent = 0.05 ;
126+ this . bulletGraph ( ) . tickStrokeThickness = 2 ;
128127
129128 // setting custom gauge ranges
130129 const range1 = new IgxLinearGraphRangeComponent ( ) ;
@@ -140,64 +139,64 @@ export class <%=ClassName%> implements AfterViewInit {
140139 range4 . startValue = 175 ;
141140 range4 . endValue = 200 ;
142141
143- this . bulletGraph . rangeBrushes = [ '#0078C8' , '#0099FF' , '#21A7FF' , '#4FB9FF' ] ;
144- this . bulletGraph . rangeOutlines = [ '#0078C8' , '#0099FF' , '#21A7FF' , '#4FB9FF' ] ;
145- this . bulletGraph . ranges . clear ( ) ;
146- this . bulletGraph . ranges . add ( range1 ) ;
147- this . bulletGraph . ranges . add ( range2 ) ;
148- this . bulletGraph . ranges . add ( range3 ) ;
149- this . bulletGraph . ranges . add ( range4 ) ;
142+ this . bulletGraph ( ) . rangeBrushes = [ '#0078C8' , '#0099FF' , '#21A7FF' , '#4FB9FF' ] ;
143+ this . bulletGraph ( ) . rangeOutlines = [ '#0078C8' , '#0099FF' , '#21A7FF' , '#4FB9FF' ] ;
144+ this . bulletGraph ( ) . ranges . clear ( ) ;
145+ this . bulletGraph ( ) . ranges . add ( range1 ) ;
146+ this . bulletGraph ( ) . ranges . add ( range2 ) ;
147+ this . bulletGraph ( ) . ranges . add ( range3 ) ;
148+ this . bulletGraph ( ) . ranges . add ( range4 ) ;
150149
151150 // setting extent of all gauge ranges
152- for ( let i = 0 ; i < this . bulletGraph . ranges . count ; i ++ ) {
153- const range = this . bulletGraph . ranges . item ( i ) ;
151+ for ( let i = 0 ; i < this . bulletGraph ( ) . ranges . count ; i ++ ) {
152+ const range = this . bulletGraph ( ) . ranges . item ( i ) ;
154153 range . innerStartExtent = 0.2 ;
155154 range . innerEndExtent = 0.2 ;
156155 range . outerStartExtent = 0.95 ;
157156 range . outerEndExtent = 0.95 ;
158157 }
159158
160159 // setting extent of gauge scale
161- this . bulletGraph . scaleBackgroundThickness = 0.5 ;
162- this . bulletGraph . scaleBackgroundBrush = '#dbdbdb' ;
163- this . bulletGraph . scaleBackgroundOutline = 'gray' ;
164- this . bulletGraph . scaleStartExtent = 0.05 ;
165- this . bulletGraph . scaleEndExtent = 0.95 ;
166- this . bulletGraph . scaleBackgroundThickness = 0 ;
160+ this . bulletGraph ( ) . scaleBackgroundThickness = 0.5 ;
161+ this . bulletGraph ( ) . scaleBackgroundBrush = '#dbdbdb' ;
162+ this . bulletGraph ( ) . scaleBackgroundOutline = 'gray' ;
163+ this . bulletGraph ( ) . scaleStartExtent = 0.05 ;
164+ this . bulletGraph ( ) . scaleEndExtent = 0.95 ;
165+ this . bulletGraph ( ) . scaleBackgroundThickness = 0 ;
167166
168167 // setting appearance of backing fill and outline
169- this . bulletGraph . backingBrush = '#f7f7f7' ;
170- this . bulletGraph . backingOutline = '#d1d1d1' ;
171- this . bulletGraph . backingStrokeThickness = 0 ;
168+ this . bulletGraph ( ) . backingBrush = '#f7f7f7' ;
169+ this . bulletGraph ( ) . backingOutline = '#d1d1d1' ;
170+ this . bulletGraph ( ) . backingStrokeThickness = 0 ;
172171 }
173172
174173 public AnimateToGauge1 ( ) : void {
175- this . bulletGraph . minimumValue = 0 ;
176- this . bulletGraph . maximumValue = 80 ;
177- this . bulletGraph . value = 70 ;
178- this . bulletGraph . interval = 20 ;
174+ this . bulletGraph ( ) . minimumValue = 0 ;
175+ this . bulletGraph ( ) . maximumValue = 80 ;
176+ this . bulletGraph ( ) . value = 70 ;
177+ this . bulletGraph ( ) . interval = 20 ;
179178
180179 // setting appearance of labels
181- this . bulletGraph . labelInterval = 20 ;
182- this . bulletGraph . labelExtent = 0.02 ;
180+ this . bulletGraph ( ) . labelInterval = 20 ;
181+ this . bulletGraph ( ) . labelExtent = 0.02 ;
183182
184183 // setting custom appearance of performance bar
185- this . bulletGraph . valueInnerExtent = 0.5 ;
186- this . bulletGraph . valueOuterExtent = 0.7 ;
187- this . bulletGraph . valueBrush = '#000000' ;
184+ this . bulletGraph ( ) . valueInnerExtent = 0.5 ;
185+ this . bulletGraph ( ) . valueOuterExtent = 0.7 ;
186+ this . bulletGraph ( ) . valueBrush = '#000000' ;
188187
189188 // setting custom appearance of target bar
190- this . bulletGraph . targetValueBrush = '#000000' ;
191- this . bulletGraph . targetValueBreadth = 10 ;
192- this . bulletGraph . targetValue = 60 ;
189+ this . bulletGraph ( ) . targetValueBrush = '#000000' ;
190+ this . bulletGraph ( ) . targetValueBreadth = 10 ;
191+ this . bulletGraph ( ) . targetValue = 60 ;
193192
194193 // setting appearance of major/minor ticks
195- this . bulletGraph . minorTickCount = 5 ;
196- this . bulletGraph . minorTickEndExtent = 0.10 ;
197- this . bulletGraph . minorTickStartExtent = 0.20 ;
198- this . bulletGraph . tickStartExtent = 0.20 ;
199- this . bulletGraph . tickEndExtent = 0.05 ;
200- this . bulletGraph . tickStrokeThickness = 2 ;
194+ this . bulletGraph ( ) . minorTickCount = 5 ;
195+ this . bulletGraph ( ) . minorTickEndExtent = 0.10 ;
196+ this . bulletGraph ( ) . minorTickStartExtent = 0.20 ;
197+ this . bulletGraph ( ) . tickStartExtent = 0.20 ;
198+ this . bulletGraph ( ) . tickEndExtent = 0.05 ;
199+ this . bulletGraph ( ) . tickStrokeThickness = 2 ;
201200
202201 // setting custom gauge ranges
203202 const range1 = new IgxLinearGraphRangeComponent ( ) ;
@@ -207,32 +206,32 @@ export class <%=ClassName%> implements AfterViewInit {
207206 range2 . startValue = 40 ;
208207 range2 . endValue = 80 ;
209208
210- this . bulletGraph . rangeBrushes = [ '#a4bd29' , '#F86232' ] ;
211- this . bulletGraph . rangeOutlines = [ '#a4bd29' , '#F86232' ] ;
212- this . bulletGraph . ranges . clear ( ) ;
213- this . bulletGraph . ranges . add ( range1 ) ;
214- this . bulletGraph . ranges . add ( range2 ) ;
209+ this . bulletGraph ( ) . rangeBrushes = [ '#a4bd29' , '#F86232' ] ;
210+ this . bulletGraph ( ) . rangeOutlines = [ '#a4bd29' , '#F86232' ] ;
211+ this . bulletGraph ( ) . ranges . clear ( ) ;
212+ this . bulletGraph ( ) . ranges . add ( range1 ) ;
213+ this . bulletGraph ( ) . ranges . add ( range2 ) ;
215214
216215 // setting extent of all gauge ranges
217- for ( let i = 0 ; i < this . bulletGraph . ranges . count ; i ++ ) {
218- const range = this . bulletGraph . ranges . item ( i ) ;
216+ for ( let i = 0 ; i < this . bulletGraph ( ) . ranges . count ; i ++ ) {
217+ const range = this . bulletGraph ( ) . ranges . item ( i ) ;
219218 range . innerStartExtent = 0.2 ;
220219 range . innerEndExtent = 0.2 ;
221220 range . outerStartExtent = 0.95 ;
222221 range . outerEndExtent = 0.95 ;
223222 }
224223
225224 // setting extent of gauge scale
226- this . bulletGraph . scaleBackgroundThickness = 0.5 ;
227- this . bulletGraph . scaleBackgroundBrush = '#dbdbdb' ;
228- this . bulletGraph . scaleBackgroundOutline = 'gray' ;
229- this . bulletGraph . scaleStartExtent = 0.05 ;
230- this . bulletGraph . scaleEndExtent = 0.95 ;
231- this . bulletGraph . scaleBackgroundThickness = 0 ;
225+ this . bulletGraph ( ) . scaleBackgroundThickness = 0.5 ;
226+ this . bulletGraph ( ) . scaleBackgroundBrush = '#dbdbdb' ;
227+ this . bulletGraph ( ) . scaleBackgroundOutline = 'gray' ;
228+ this . bulletGraph ( ) . scaleStartExtent = 0.05 ;
229+ this . bulletGraph ( ) . scaleEndExtent = 0.95 ;
230+ this . bulletGraph ( ) . scaleBackgroundThickness = 0 ;
232231
233232 // setting appearance of backing fill and outline
234- this . bulletGraph . backingBrush = '#f7f7f7' ;
235- this . bulletGraph . backingOutline = '#d1d1d1' ;
236- this . bulletGraph . backingStrokeThickness = 0 ;
233+ this . bulletGraph ( ) . backingBrush = '#f7f7f7' ;
234+ this . bulletGraph ( ) . backingOutline = '#d1d1d1' ;
235+ this . bulletGraph ( ) . backingStrokeThickness = 0 ;
237236 }
238237}
0 commit comments