forked from Teradata/covalent
-
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.
feat(): implement tooltip component (Teradata#9)
feat(): implement tooltip component
- Loading branch information
1 parent
2d6f425
commit 2f7e85d
Showing
35 changed files
with
799 additions
and
295 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,7 +1,86 @@ | ||
<h3>TEST</h3> | ||
<td-chart [style.height.px]="300" | ||
<h3>Bar Test</h3> | ||
<td-base-chart [style.height.px]="300" | ||
[yAxisType]="'value'" | ||
[xAxisType]="'category'" | ||
[dataZoom]="false" | ||
[data]="plot"> | ||
</td-chart> | ||
[data]="barPlot"> | ||
<td-chart-tooltip [trigger]="'item'"> | ||
<ng-template let-params let-ticket="ticket" tdTooltipFormatter> | ||
<ng-container *ngIf="params"> | ||
<div layout="row" layout-align="start center"> | ||
<mat-icon> | ||
<span class="tc-blue-300">person</span> | ||
</mat-icon> | ||
<span class="mat-caption pad-left-sm"> | ||
{{params.seriesName + ': ' + params.value}} | ||
</span> | ||
</div> | ||
</ng-container> | ||
</ng-template> | ||
</td-chart-tooltip> | ||
</td-base-chart> | ||
<h3>Bar Test 2</h3> | ||
<td-chart-bar [style.height.px]="300" | ||
[data]="barPlot"> | ||
<td-chart-tooltip [trigger]="'item'"> | ||
<ng-template let-params let-ticket="ticket" tdTooltipFormatter> | ||
<ng-container *ngIf="params"> | ||
<div layout="row" layout-align="start center"> | ||
<mat-icon> | ||
<span class="tc-blue-300">person</span> | ||
</mat-icon> | ||
<span class="mat-caption pad-left-sm"> | ||
{{params.seriesName + ': ' + params.value}} | ||
</span> | ||
</div> | ||
</ng-container> | ||
</ng-template> | ||
</td-chart-tooltip> | ||
</td-chart-bar> | ||
<h3>Line Test</h3> | ||
<div layout="row"> | ||
<button mat-button (click)="showTooltip = !showTooltip"> | ||
Show/Hide Tooltip | ||
</button> | ||
</div> | ||
<td-base-chart [style.height.px]="300" | ||
[data]="linePlot"> | ||
<td-chart-tooltip [show]="showTooltip"> | ||
<ng-template let-params let-ticket="ticket" tdTooltipFormatter> | ||
<ng-container *ngIf="params"> | ||
<div layout="row" layout-align="start center"> | ||
<mat-icon> | ||
<span class="tc-blue-300">update_time</span> | ||
</mat-icon> | ||
<span class="mat-caption pad-left-sm"> | ||
{{params[0].seriesName + ': ' + params[0].value[1]}} | ||
</span> | ||
</div> | ||
<div class="mat-caption"> | ||
at {{(params[0].name | date:'medium')}} | ||
</div> | ||
</ng-container> | ||
</ng-template> | ||
</td-chart-tooltip> | ||
</td-base-chart> | ||
<h3>Line Test 2</h3> | ||
<td-chart-line [style.height.px]="300" | ||
[data]="linePlot"> | ||
<td-chart-tooltip> | ||
<ng-template let-params let-ticket="ticket" tdTooltipFormatter> | ||
<ng-container *ngIf="params"> | ||
<div layout="row" layout-align="start center"> | ||
<mat-icon> | ||
<span class="tc-blue-300">update_time</span> | ||
</mat-icon> | ||
<span class="mat-caption pad-left-sm"> | ||
{{params[0].seriesName + ': ' + params[0].value[1]}} | ||
</span> | ||
</div> | ||
<div class="mat-caption"> | ||
at {{(params[0].name | date:'medium')}} | ||
</div> | ||
</ng-container> | ||
</ng-template> | ||
</td-chart-tooltip> | ||
</td-chart-line> |
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
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
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,8 @@ | ||
<td-base-chart [style.height.%]="100" | ||
[data]="data" | ||
[yAxisType]="'value'" | ||
[xAxisType]="'category'" | ||
[dataZoom]="false" | ||
[dataZoom]="false"> | ||
<ng-content></ng-content> | ||
</td-base-chart> |
File renamed without changes.
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,22 @@ | ||
import { | ||
Component, | ||
Input, | ||
ChangeDetectionStrategy, | ||
} from '@angular/core'; | ||
|
||
import 'echarts/lib/chart/bar'; | ||
|
||
import { BASE_CHART_PROVIDER } from '@covalent/echarts/base'; | ||
|
||
@Component({ | ||
selector: 'td-chart-bar', | ||
templateUrl: './bar.component.html', | ||
styleUrls: ['./bar.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
providers: [BASE_CHART_PROVIDER], | ||
}) | ||
export class TdBarChartComponent { | ||
|
||
@Input('data') data: any[]; | ||
|
||
} |
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,26 @@ | ||
import { NgModule, Type } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { CovalentBaseEchartsModule } from '@covalent/echarts/base'; | ||
|
||
import { TdBarChartComponent } from './bar.component'; | ||
|
||
export const BAR_MODULE_COMPONENTS: Type<any>[] = [ | ||
TdBarChartComponent, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
CovalentBaseEchartsModule, | ||
], | ||
declarations: [ | ||
BAR_MODULE_COMPONENTS, | ||
], | ||
exports: [ | ||
BAR_MODULE_COMPONENTS, | ||
], | ||
}) | ||
export class CovalentBarEchartsModule { | ||
|
||
} |
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 @@ | ||
export * from './public-api'; |
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,7 @@ | ||
{ | ||
"ngPackage": { | ||
"lib": { | ||
"entryFile": "index.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,2 @@ | ||
export * from './bar.module'; | ||
export { TdBarChartComponent } from './bar.component'; |
File renamed without changes.
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,3 @@ | ||
:host { | ||
display: block; | ||
} |
File renamed without changes.
Oops, something went wrong.