Skip to content

Commit

Permalink
Add SeparationLineComponent for visual separation in charts
Browse files Browse the repository at this point in the history
This commit introduces the SeparationLineComponent, which provides a styled separation line for visual clarity between chart sections. The component includes its own CSS for styling, an HTML template, and a basic spec file for testing. The component is utilized in the label-chart component to visually distinguish comparison charts.
  • Loading branch information
ludeknovy committed Sep 27, 2024
1 parent 1a58123 commit 7a982e9
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/item-detail/item-detail.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { ThresholdFailureComponent } from "./request-stats/threshold-failure/thr
import { ZoomChartsComponent } from "./zoom-charts/zoom-charts.component";
import { ErrorSummaryComponent } from "./error-summary/error-summary.component";
import { ValidationsModule } from "./validations/validations.module";
import { SeparationLineComponent } from './separation-line/separation-line.component';

Check failure on line 34 in src/app/item-detail/item-detail.module.ts

View workflow job for this annotation

GitHub Actions / build

Strings must use doublequote


const routes: Routes = [{
Expand All @@ -43,7 +44,7 @@ const routes: Routes = [{
declarations: [ItemDetailComponent, RequestStatsComponent, ThresholdsAlertComponent,
PerformanceAnalysisComponent, LabelChartComponent, AnalyzeChartsComponent,
LabelHealthComponent, LabelTrendComponent, StatsCompareComponent, AddMetricComponent, ShareComponent, DeleteShareLinkComponent,
CreateNewShareLinkComponent, MonitoringStatsComponent, ReloadCustomChartComponent, ChartIntervalComponent, ForbiddenComponent, ThresholdFailureComponent, ZoomChartsComponent, ErrorSummaryComponent],
CreateNewShareLinkComponent, MonitoringStatsComponent, ReloadCustomChartComponent, ChartIntervalComponent, ForbiddenComponent, ThresholdFailureComponent, ZoomChartsComponent, ErrorSummaryComponent, SeparationLineComponent],
imports: [
CommonModule, NgbModule, RouterModule.forRoot(routes), DataTableModule, SharedItemModule, SharedModule, HighchartsChartModule, ValidationsModule,
ReactiveFormsModule, FormsModule, RoleModule,
Expand Down
4 changes: 4 additions & 0 deletions src/app/item-detail/label-chart/label-chart.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ <h6 class="card-header bg-transparent">
<highcharts-chart #labelChart [Highcharts]="Highcharts" [options]="labelChartOptions" [callbackFunction]="chartCallback" [(update)]="updateLabelChartFlag"
class="highchart-chart"
style="width: 100%; height: 100%; display: block;"></highcharts-chart>

<app-separation-line *ngIf="comparisonLabelChartOptions"></app-separation-line>

<div *ngIf="comparisonLabelChartOptions">

<highcharts-chart #labelComparisonChart [Highcharts]="Highcharts" [options]="comparisonLabelChartOptions" [callbackFunction]="comparisonChartCallback" [(update)]="updateLabelChartFlag"
class="highchart-chart"
style="width: 100%; height: 100%; display: block;"></highcharts-chart>
Expand Down
29 changes: 29 additions & 0 deletions src/app/item-detail/separation-line/separation-line.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

.separation-line {
overflow: hidden;
text-align: center;
margin-top: 1.5rem;
margin-bottom: 0.8rem;
}

.separation-line::before,
.separation-line::after {
content: "";
display: inline-block;
height: 2px;
position: relative;
vertical-align: middle;
width: 50%;
border: none;
border-top: 1px dotted #a1b3df;
}

.separation-line::before {
right: 0.5em;
margin-left: -50%;
}

.separation-line::after {
left: 0.5em;
margin-right: -50%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h6 class="separation-line">Comparing Chart</h6>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from "@angular/core/testing";

import { SeparationLineComponent } from "./separation-line.component";

describe("SeparationLineComponent", () => {
let component: SeparationLineComponent;
let fixture: ComponentFixture<SeparationLineComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [SeparationLineComponent]
})
.compileComponents();

fixture = TestBed.createComponent(SeparationLineComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it("should create", () => {
expect(component).toBeTruthy();
});
});
10 changes: 10 additions & 0 deletions src/app/item-detail/separation-line/separation-line.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from "@angular/core";

@Component({
selector: 'app-separation-line',
templateUrl: './separation-line.component.html',
styleUrls: ['./separation-line.component.css']
})
export class SeparationLineComponent {

}

0 comments on commit 7a982e9

Please sign in to comment.