File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed
metrics/views/card_renderer Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 113
113
[useDarkMode] ="useDarkMode "
114
114
(onViewBoxOverridden) ="isViewBoxOverridden = $event "
115
115
(viewBoxChanged) ="onLineChartZoom.emit($event) "
116
+ [customVisTemplate] ="lineChartCustomVis "
116
117
[customChartOverlayTemplate] ="lineChartCustomXAxisVis "
117
118
> </ line-chart >
118
119
< ng-template
181
182
</ scalar-card-data-table >
182
183
</ div >
183
184
</ ng-container >
185
+ < ng-template
186
+ #lineChartCustomVis
187
+ let-viewExtent ="viewExtent "
188
+ let-domDim ="domDimension "
189
+ let-xScale ="xScale "
190
+ >
191
+ < ng-container *ngIf ="stepOrLinkedTimeSelection ">
192
+ < div
193
+ [ngClass] ="{
194
+ 'out-of-selected-time': true,
195
+ start: true,
196
+ range: !!stepOrLinkedTimeSelection.end?.step
197
+ } "
198
+ [style.right] ="
199
+ xScale.forward(
200
+ viewExtent.x,
201
+ [domDim.width, 0],
202
+ stepOrLinkedTimeSelection.start.step
203
+ ) + 'px'
204
+ "
205
+ > </ div >
206
+ < div
207
+ *ngIf ="stepOrLinkedTimeSelection.end?.step "
208
+ [ngClass] ="{
209
+ 'out-of-selected-time': true,
210
+ end: true,
211
+ range: true
212
+ } "
213
+ [style.left] ="
214
+ xScale.forward(
215
+ viewExtent.x,
216
+ [0, domDim.width],
217
+ stepOrLinkedTimeSelection.end?.step
218
+ ) + 'px'
219
+ "
220
+ > </ div >
221
+ </ ng-container >
222
+ </ ng-template >
223
+
184
224
< ng-template
185
225
#lineChartCustomXAxisVis
186
226
let-viewExtent ="viewExtent "
Original file line number Diff line number Diff line change 54
54
(onViewExtentReset) ="viewBoxReset() "
55
55
(onInteractionStateChange) ="onInteractionStateChange($event) "
56
56
> </ line-chart-interactive-view >
57
+ < div *ngIf ="customVisTemplate " class ="custom-vis ">
58
+ < ng-container
59
+ [ngTemplateOutlet] ="customVisTemplate "
60
+ [ngTemplateOutletContext] ="{
61
+ xScale: xScale,
62
+ yScale: yScale,
63
+ domDimension: domDimensions.main,
64
+ viewExtent: viewBox
65
+ } "
66
+ > </ ng-container >
67
+ </ div >
57
68
</ div >
58
69
< div class ="y-axis " #yAxis >
59
70
< line-chart-axis
Original file line number Diff line number Diff line change @@ -92,6 +92,14 @@ export class LineChartComponent
92
92
@ViewChild ( 'chartEl' , { static : false , read : ElementRef } )
93
93
private chartEl ?: ElementRef < HTMLCanvasElement | SVGElement > ;
94
94
95
+ /**
96
+ * Optional ngTemplate that renders on top of line chart (not axis). This
97
+ * template is rendered on top of interactive layer and can mask other
98
+ * contents. Do note that this component may not intercept pointer-events.
99
+ */
100
+ @Input ( )
101
+ customVisTemplate ?: TemplateRef < TemplateContext > ;
102
+
95
103
@Input ( )
96
104
customChartOverlayTemplate ?: TemplateRef <
97
105
TemplateContext & { formatter : Formatter }
You can’t perform that action at this time.
0 commit comments