Skip to content

feat: Adding bar gauge new style #1091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
}
}
}

&.single-bar {
.title {
@include body-2-regular($gray-7);
margin-right: 12px;
}
}
}

.bar {
Expand Down Expand Up @@ -90,6 +97,11 @@
width: 1px;
background: white;
}

&.single-bar {
height: 6px;
width: 80px;
}
}

.legend {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div class="bar-gauge" (htLayoutChange)="this.checkNearMaxValue()">
<div class="header-data" [ngClass]="this.display">
<div *ngIf="this.display !== '${BarGaugeStyle.SingleBar}'" class="header-data" [ngClass]="this.display">
<div *ngIf="this.title" class="title">{{ this.title | htDisplayTitle }}</div>
<div class="count">
<span>{{ this.totalValue | htDisplayNumber }}</span>
Expand All @@ -34,7 +34,7 @@ import {
<span class="units" *ngIf="this.units && !this.isUnlimited"> {{ this.units }}</span>
</div>
</div>
<div class="bar">
<div class="bar" [ngClass]="this.display">
<div #maxValueBar class="max-value-bar" [ngClass]="{ 'over-max-value': this.overMaxValue }">
<div class="segment-bars">
<div
Expand Down Expand Up @@ -162,5 +162,6 @@ interface BarSegment extends Segment {

export const enum BarGaugeStyle {
Regular = 'regular',
Compact = 'compact'
Compact = 'compact',
SingleBar = 'single-bar'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be naming could have been different. All of these are single bars only rights?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but the rest of the gauges have bars, references, title, etc... So in this case I have only a single bar.

}