-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
116 additions
and
3 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
apps/taiga-lumbermill/src/dashboards/iot/components/BarChart/bar-chart.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<div class="flex"> | ||
<tui-axes | ||
class="axes" | ||
[axisXLabels]="labelsX" | ||
[axisYLabels]="labelsY" | ||
> | ||
<tui-bar-chart | ||
[max]="10000" | ||
[tuiHintAppearance]="appearance" | ||
[tuiHintContent]="hint" | ||
[value]="value" | ||
/> | ||
</tui-axes> | ||
|
||
<tui-axes | ||
class="axes" | ||
[axisXLabels]="labelsX" | ||
[axisYLabels]="labelsY" | ||
> | ||
<tui-bar-chart | ||
[collapsed]="true" | ||
[max]="10000" | ||
[tuiHintAppearance]="appearance" | ||
[tuiHintContent]="hint" | ||
[value]="value" | ||
/> | ||
</tui-axes> | ||
</div> | ||
|
||
<tui-select | ||
class="select" | ||
[(ngModel)]="appearance" | ||
> | ||
Hint appearance | ||
<tui-data-list-wrapper | ||
*tuiDataList | ||
[items]="appearances" | ||
/> | ||
</tui-select> |
23 changes: 23 additions & 0 deletions
23
apps/taiga-lumbermill/src/dashboards/iot/components/BarChart/bar-chart.component.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.axes { | ||
height: 18.75rem; | ||
width: 37.5rem; | ||
|
||
&:first-child { | ||
--tui-chart-categorical-00: gold; | ||
--tui-chart-categorical-01: purple; | ||
} | ||
|
||
&:last-child { | ||
---tui-chart-categorical-00: skyblue; | ||
--tui-chart-categorical-01: violet; | ||
} | ||
} | ||
|
||
.flex { | ||
display: flex; | ||
min-width: 31.25rem; | ||
} | ||
|
||
.select { | ||
max-width: 20rem; | ||
} |
43 changes: 43 additions & 0 deletions
43
apps/taiga-lumbermill/src/dashboards/iot/components/BarChart/bar-chart.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {ChangeDetectionStrategy, Component} from '@angular/core'; | ||
import {FormsModule} from '@angular/forms'; | ||
import {TuiAxes, TuiBarChart} from '@taiga-ui/addon-charts'; | ||
import type {TuiContext} from '@taiga-ui/cdk'; | ||
import {tuiFormatNumber, TuiHint} from '@taiga-ui/core'; | ||
import {TuiDataListWrapper} from '@taiga-ui/kit'; | ||
import {TuiSelectModule} from '@taiga-ui/legacy'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'app-bar-chart', | ||
imports: [ | ||
CommonModule, | ||
TuiAxes, | ||
TuiBarChart, | ||
TuiSelectModule, | ||
FormsModule, | ||
TuiDataListWrapper, | ||
TuiHint, | ||
TuiAxes, | ||
], | ||
templateUrl: './bar-chart.component.html', | ||
styleUrl: './bar-chart.component.less', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class BarChartCmponent { | ||
protected readonly value = [ | ||
[1000, 8000, 4000, 3000, 4000], | ||
[6000, 2000, 4500, 7000, 5000], | ||
]; | ||
|
||
protected readonly labelsX = ['Jan 2021', 'Feb', 'Mar']; | ||
protected readonly labelsY = ['0', '10 000']; | ||
protected readonly appearances = ['dark', 'error']; | ||
|
||
protected appearance = this.appearances[0]; | ||
|
||
protected readonly hint = ({$implicit}: TuiContext<number>): string => | ||
this.value | ||
.reduce((result, set) => `${result}$${tuiFormatNumber(set[$implicit])}\n`, '') | ||
.trim(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
> | ||
<app-line-chart /> | ||
<app-small-card /> | ||
<app-bar-chart /> | ||
</tui-tiles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters