Skip to content

Commit 4540b18

Browse files
Patricio AlbizuPatricio Albizu
authored andcommitted
feat: Adding bar gauge new style
1 parent 1f175de commit 4540b18

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

projects/observability/src/shared/components/bar-gauge/bar-gauge.component.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@
4646
}
4747
}
4848
}
49+
50+
&.single-bar {
51+
.title {
52+
@include body-2-regular($gray-7);
53+
margin-right: 12px;
54+
}
55+
}
4956
}
5057

5158
.bar {
@@ -90,6 +97,11 @@
9097
width: 1px;
9198
background: white;
9299
}
100+
101+
&.single-bar {
102+
height: 6px;
103+
width: 80px;
104+
}
93105
}
94106

95107
.legend {

projects/observability/src/shared/components/bar-gauge/bar-gauge.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
changeDetection: ChangeDetectionStrategy.OnPush,
2525
template: `
2626
<div class="bar-gauge" (htLayoutChange)="this.checkNearMaxValue()">
27-
<div class="header-data" [ngClass]="this.display">
27+
<div *ngIf="this.display !== '${BarGaugeStyle.SingleBar}'" class="header-data" [ngClass]="this.display">
2828
<div *ngIf="this.title" class="title">{{ this.title | htDisplayTitle }}</div>
2929
<div class="count">
3030
<span>{{ this.totalValue | htDisplayNumber }}</span>
@@ -34,7 +34,7 @@ import {
3434
<span class="units" *ngIf="this.units && !this.isUnlimited"> {{ this.units }}</span>
3535
</div>
3636
</div>
37-
<div class="bar">
37+
<div class="bar" [ngClass]="this.display">
3838
<div #maxValueBar class="max-value-bar" [ngClass]="{ 'over-max-value': this.overMaxValue }">
3939
<div class="segment-bars">
4040
<div
@@ -162,5 +162,6 @@ interface BarSegment extends Segment {
162162

163163
export const enum BarGaugeStyle {
164164
Regular = 'regular',
165-
Compact = 'compact'
165+
Compact = 'compact',
166+
SingleBar = 'single-bar'
166167
}

0 commit comments

Comments
 (0)