Angular ブレット グラフの概要
Angular Bullet Graph コンポーネントは、目盛り上でメジャーの比較を簡潔にリニアで表示します。
ブレット グラフ コンポーネントは、きれいなデータ表現を作成するための多数の機能をサポートします。ブレット グラフは、目標に対する進捗状況、評価の範囲、複数の測定比較を表現する際に最も効率的で効果的なグラフの 1 つです。ブレット グラフは、水平または垂直のわずかな領域で、ゴールに至る進捗、評価の範囲、複数の測定比較を表現するための最も効率的で効果的な方法の 1 つです。
Angular ブレット グラフの例
以下のサンプルは、同じ IgxBulletGraphComponent
でいくつかのプロパティを設定して全く異なるゲージにする方法を示します。
import { NgModule } from "@angular/core" ;
import { FormsModule } from "@angular/forms" ;
import { CommonModule } from "@angular/common" ;
import { BrowserModule } from "@angular/platform-browser" ;
import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
import { AppComponent } from "./app.component" ;
import { IgxBulletGraphModule } from "igniteui-angular-gauges" ;
import { IgxButtonModule } from "igniteui-angular" ;
@NgModule ({
bootstrap : [AppComponent],
declarations : [
AppComponent,
],
imports : [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
IgxBulletGraphModule,
IgxButtonModule
],
providers : [],
schemas : []
})
export class AppModule {}
ts コピー import { AfterViewInit, Component, ViewChild } from "@angular/core" ;
import { IgxBulletGraphComponent } from "igniteui-angular-gauges" ;
import { IgxLinearGraphRangeComponent } from "igniteui-angular-gauges" ;
@Component ({
standalone : false ,
selector : "app-root" ,
styleUrls : ["./app.component.scss" ],
templateUrl : "./app.component.html"
})
export class AppComponent implements AfterViewInit {
@ViewChild ("bulletGraph" , { static : true })
public bulletGraph: IgxBulletGraphComponent;
private shouldAnimate: boolean = false ;
public ngAfterViewInit(): void {
this .AnimateToGauge3();
}
public AnimateToGauge3(): void {
if (this .shouldAnimate){
this .bulletGraph.transitionDuration = 500 ;
}
this .bulletGraph.minimumValue = 0 ;
this .bulletGraph.maximumValue = 120 ;
this .bulletGraph.value = 70 ;
this .bulletGraph.interval = 10 ;
this .bulletGraph.labelInterval = 10 ;
this .bulletGraph.labelExtent = 0.02 ;
this .bulletGraph.valueInnerExtent = 0.5 ;
this .bulletGraph.valueOuterExtent = 0.7 ;
this .bulletGraph.valueBrush = "#000000" ;
this .bulletGraph.targetValueBrush = "#000000" ;
this .bulletGraph.targetValueBreadth = 10 ;
this .bulletGraph.targetValue = 90 ;
this .bulletGraph.minorTickCount = 5 ;
this .bulletGraph.minorTickEndExtent = 0.10 ;
this .bulletGraph.minorTickStartExtent = 0.20 ;
this .bulletGraph.tickStartExtent = 0.20 ;
this .bulletGraph.tickEndExtent = 0.05 ;
this .bulletGraph.tickStrokeThickness = 2 ;
const range1 = new IgxLinearGraphRangeComponent();
range1.startValue = 0 ;
range1.endValue = 40 ;
const range2 = new IgxLinearGraphRangeComponent();
range2.startValue = 40 ;
range2.endValue = 80 ;
const range3 = new IgxLinearGraphRangeComponent();
range3.startValue = 80 ;
range3.endValue = 120 ;
this .bulletGraph.rangeBrushes = [ "#FF9800" , "#F96232" , "#C62828" ];
this .bulletGraph.rangeOutlines = [ "#FF9800" , "#F96232" , "#C62828" ];
this .bulletGraph.ranges.clear();
this .bulletGraph.ranges.add(range1);
this .bulletGraph.ranges.add(range2);
this .bulletGraph.ranges.add(range3);
for (let i = 0 ; i < this .bulletGraph.ranges.count; i++) {
const range = this .bulletGraph.ranges.item(i);
range.innerStartExtent = 0.2 ;
range.innerEndExtent = 0.2 ;
range.outerStartExtent = 0.95 ;
range.outerEndExtent = 0.95 ;
}
this .bulletGraph.scaleBackgroundThickness = 0.5 ;
this .bulletGraph.scaleBackgroundBrush = "#dbdbdb" ;
this .bulletGraph.scaleBackgroundOutline = "gray" ;
this .bulletGraph.scaleStartExtent = 0.05 ;
this .bulletGraph.scaleEndExtent = 0.95 ;
this .bulletGraph.scaleBackgroundThickness = 0 ;
this .bulletGraph.backingBrush = "#f7f7f7" ;
this .bulletGraph.backingOutline = "#d1d1d1" ;
this .bulletGraph.backingStrokeThickness = 0 ;
this .shouldAnimate = true ;
}
public AnimateToGauge2(): void {
if (this .shouldAnimate){
this .bulletGraph.transitionDuration = 500 ;
}
this .bulletGraph.minimumValue = 100 ;
this .bulletGraph.maximumValue = 200 ;
this .bulletGraph.value = 120 ;
this .bulletGraph.interval = 10 ;
this .bulletGraph.labelInterval = 10 ;
this .bulletGraph.labelExtent = 0.02 ;
this .bulletGraph.valueInnerExtent = 0.5 ;
this .bulletGraph.valueOuterExtent = 0.7 ;
this .bulletGraph.valueBrush = "#000000" ;
this .bulletGraph.targetValueBrush = "#000000" ;
this .bulletGraph.targetValueBreadth = 10 ;
this .bulletGraph.targetValue = 180 ;
this .bulletGraph.minorTickCount = 5 ;
this .bulletGraph.minorTickEndExtent = 0.10 ;
this .bulletGraph.minorTickStartExtent = 0.20 ;
this .bulletGraph.tickStartExtent = 0.20 ;
this .bulletGraph.tickEndExtent = 0.05 ;
this .bulletGraph.tickStrokeThickness = 2 ;
const range1 = new IgxLinearGraphRangeComponent();
range1.startValue = 100 ;
range1.endValue = 125 ;
const range2 = new IgxLinearGraphRangeComponent();
range2.startValue = 125 ;
range2.endValue = 150 ;
const range3 = new IgxLinearGraphRangeComponent();
range3.startValue = 150 ;
range3.endValue = 175 ;
const range4 = new IgxLinearGraphRangeComponent();
range4.startValue = 175 ;
range4.endValue = 200 ;
this .bulletGraph.rangeBrushes = [ "#0078C8" , "#0099FF" , "#21A7FF" , "#4FB9FF" ];
this .bulletGraph.rangeOutlines = [ "#0078C8" , "#0099FF" , "#21A7FF" , "#4FB9FF" ];
this .bulletGraph.ranges.clear();
this .bulletGraph.ranges.add(range1);
this .bulletGraph.ranges.add(range2);
this .bulletGraph.ranges.add(range3);
this .bulletGraph.ranges.add(range4);
for (let i = 0 ; i < this .bulletGraph.ranges.count; i++) {
const range = this .bulletGraph.ranges.item(i);
range.innerStartExtent = 0.2 ;
range.innerEndExtent = 0.2 ;
range.outerStartExtent = 0.95 ;
range.outerEndExtent = 0.95 ;
}
this .bulletGraph.scaleBackgroundThickness = 0.5 ;
this .bulletGraph.scaleBackgroundBrush = "#dbdbdb" ;
this .bulletGraph.scaleBackgroundOutline = "gray" ;
this .bulletGraph.scaleStartExtent = 0.05 ;
this .bulletGraph.scaleEndExtent = 0.95 ;
this .bulletGraph.scaleBackgroundThickness = 0 ;
this .bulletGraph.backingBrush = "#f7f7f7" ;
this .bulletGraph.backingOutline = "#d1d1d1" ;
this .bulletGraph.backingStrokeThickness = 0 ;
this .shouldAnimate = true ;
}
public AnimateToGauge1(): void {
if (this .shouldAnimate){
this .bulletGraph.transitionDuration = 500 ;
}
this .bulletGraph.minimumValue = 0 ;
this .bulletGraph.maximumValue = 80 ;
this .bulletGraph.value = 70 ;
this .bulletGraph.interval = 20 ;
this .bulletGraph.labelInterval = 20 ;
this .bulletGraph.labelExtent = 0.02 ;
this .bulletGraph.valueInnerExtent = 0.5 ;
this .bulletGraph.valueOuterExtent = 0.7 ;
this .bulletGraph.valueBrush = "#000000" ;
this .bulletGraph.targetValueBrush = "#000000" ;
this .bulletGraph.targetValueBreadth = 10 ;
this .bulletGraph.targetValue = 60 ;
this .bulletGraph.minorTickCount = 5 ;
this .bulletGraph.minorTickEndExtent = 0.10 ;
this .bulletGraph.minorTickStartExtent = 0.20 ;
this .bulletGraph.tickStartExtent = 0.20 ;
this .bulletGraph.tickEndExtent = 0.05 ;
this .bulletGraph.tickStrokeThickness = 2 ;
const range1 = new IgxLinearGraphRangeComponent();
range1.startValue = 0 ;
range1.endValue = 40 ;
const range2 = new IgxLinearGraphRangeComponent();
range2.startValue = 40 ;
range2.endValue = 80 ;
this .bulletGraph.rangeBrushes = [ "#a4bd29" , "#F86232" ];
this .bulletGraph.rangeOutlines = [ "#a4bd29" , "#F86232" ];
this .bulletGraph.ranges.clear();
this .bulletGraph.ranges.add(range1);
this .bulletGraph.ranges.add(range2);
for (let i = 0 ; i < this .bulletGraph.ranges.count; i++) {
const range = this .bulletGraph.ranges.item(i);
range.innerStartExtent = 0.2 ;
range.innerEndExtent = 0.2 ;
range.outerStartExtent = 0.95 ;
range.outerEndExtent = 0.95 ;
}
this .bulletGraph.scaleBackgroundThickness = 0.5 ;
this .bulletGraph.scaleBackgroundBrush = "#dbdbdb" ;
this .bulletGraph.scaleBackgroundOutline = "gray" ;
this .bulletGraph.scaleStartExtent = 0.05 ;
this .bulletGraph.scaleEndExtent = 0.95 ;
this .bulletGraph.scaleBackgroundThickness = 0 ;
this .bulletGraph.backingBrush = "#f7f7f7" ;
this .bulletGraph.backingOutline = "#d1d1d1" ;
this .bulletGraph.backingStrokeThickness = 0 ;
this .shouldAnimate = true ;
}
}
ts コピー <div class ="container vertical" >
<div class ="options horizontal" >
<button (click )="AnimateToGauge1()"
class ="options-button" > Animation #1</button >
<button (click )="AnimateToGauge2()"
class ="options-button" > Animation #2</button >
<button (click )="AnimateToGauge3()"
class ="options-button" > Animation #3</button >
</div >
<div class ="container" >
<igx-bullet-graph
#bulletGraph
height ="80px"
width ="400px"
minimumValue =0
maximumValue =120
valueBrush ="#4286f4"
value =70
targetValueBrush ="#4286f4"
targetValue =90
targetValueBreadth =10
interval =10
labelInterval =10
labelExtent =0.02
rangeBrushes ="#FF9800, #F96232, #C62828"
rangeOutlines ="#FF9800, #F96232, #C62828"
scaleBackgroundThickness =0
scaleBackgroundBrush ="#dbdbdb"
scaleBackgroundOutline ="gray" >
</igx-bullet-graph >
</div >
</div >
html コピー
このサンプルが気に入りましたか? 完全な Ignite UI for Angularツールキットにアクセスして、すばやく独自のアプリの作成を開始します。無料でダウンロードできます。
このゲージは、スケール、針、目盛 (1 組)、ラベル (1 組) をサポートします。このコンポーネントには、アニメーション化されたトランジションのサポートも組み込まれています。アニメーションは、transitionDuration
プロパティの設定で簡単にカスタマイズできます。
ブレット グラフの機能には構成可能な向きや方向、視覚要素やツールチップなどがあります。
依存関係
gauge パッケージのインストール時に core パッケージもインストールする必要があります。
npm install --save igniteui-angular-core
npm install --save igniteui-angular-gauges
cmd
モジュールの要件
IgxBulletGraphComponent
を作成するには、以下のモジュールが必要です。
import { IgxBulletGraphModule } from 'igniteui-angular-gauges' ;
@NgModule ({
imports : [
IgxBulletGraphModule
]
})
export class AppModule {}
ts
使用方法
以下のコードは、ブレット グラフ コンポーネントを作成し、パフォ―マンス バーと比較目盛マーカー、および 3 つの比較範囲をスケールに構成します。
<igx-bullet-graph height ="100"
width ="300"
minimumValue ="5"
maximumValue ="55"
value ="35"
targetValue ="43" >
<igx-linear-graph-range startValue ="0"
endValue ="15"
brush ="#828181" >
</igx-linear-graph-range >
<igx-linear-graph-range startValue ="15"
endValue ="30"
brush ="#AAAAAA" >
</igx-linear-graph-range >
<igx-linear-graph-range startValue ="30"
endValue ="55"
brush ="#D0D0D0" >
</igx-linear-graph-range >
</igx-bullet-graph >
html
比較メジャー
ブレットグラフは、パフォーマンス値とターゲット値の 2 つのメジャーを表示できます。
パフォーマンス値は、コンポーネントで表示されるプライマリ メジャーでグラフ全体の長さに沿って拡張するバーとして表示されます。ターゲット値は、パフォーマンス値が比較の対象とするメジャーでパフォーマンス バーの向きに対して直角に交わる小さなブロックとして表示されます。
<igx-bullet-graph
value =50
valueBrush ="DodgerBlue"
valueStrokeThickness =1
valueInnerExtent =0.5
valueOuterExtent =0.65
targetValue =80
targetValueBreadth =10
targetValueBrush ="LimeGreen"
targetValueOutline ="LimeGreen"
targetValueStrokeThickness =1
targetValueInnerExtent =0.3
targetValueOuterExtent =0.85
height ="80px" width ="400px"
minimumValue =0 value =50
maximumValue =100 >
</igx-bullet-graph >
html
import { NgModule } from "@angular/core" ;
import { FormsModule } from "@angular/forms" ;
import { CommonModule } from "@angular/common" ;
import { BrowserModule } from "@angular/platform-browser" ;
import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
import { AppComponent } from "./app.component" ;
import { IgxBulletGraphModule } from "igniteui-angular-gauges" ;
@NgModule ({
bootstrap : [AppComponent],
declarations : [
AppComponent,
],
imports : [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
IgxBulletGraphModule
],
providers : [],
schemas : []
})
export class AppModule {}
ts コピー import { Component, ViewChild } from "@angular/core" ;
import { IgxBulletGraphComponent } from "igniteui-angular-gauges" ;
@Component ({
standalone : false ,
selector : "app-root" ,
styleUrls : ["./app.component.scss" ],
templateUrl : "./app.component.html"
})
export class AppComponent {
@ViewChild ("bulletGraph" , { static : true })
public bulletGraph: IgxBulletGraphComponent;
}
ts コピー <div class ="container vertical" >
<igx-bullet-graph
#bulletGraph
height ="80px" width ="400px"
minimumValue =0
maximumValue =100
value =50
valueBrush ="DodgerBlue"
valueStrokeThickness =1
valueInnerExtent =0.5
valueOuterExtent =0.65
targetValue =80
targetValueBreadth =10
targetValueBrush ="LimeGreen"
targetValueOutline ="LimeGreen"
targetValueStrokeThickness =1
targetValueInnerExtent =0.3
targetValueOuterExtent =0.85
scaleBackgroundBrush = "#e5e5e5"
scaleBackgroundOutline = "#e5e5e5"
backingBrush = "#f7f7f7"
backingOutline = "#bfbfbf"
tickStrokeThickness = 1.5 >
</igx-bullet-graph >
</div >
html コピー
ハイライト値
バレット グラフのパフォーマンス値をさらに変更して、進捗状況をハイライト値として表示することもできます。これにより、value
が低い不透明度で表示されます。良い例としては、value
が 50 で、highlightValue
が 25 に設定されている場合です。これは、targetValue
の値が何に設定されているかに関係なく、50% のパフォーマンスを表します。これを有効にするには、まず highlightValueDisplayMode
を Overlay に設定し、次に highlightValue
を value
よりも低い値に適用します。
<igx-bullet-graph
#bulletGraph
height ="80px"
width ="400px"
value =70
targetValue =90
minimumValue =0
maximumValue =100
interval =10
labelInterval =10
labelExtent =0.025
labelsPreTerminal =0
labelsPostInitial =0
highlightValueDisplayMode ="Overlay"
highlightValue =25 >
</igx-bullet-graph >
html
import { NgModule } from "@angular/core" ;
import { FormsModule } from "@angular/forms" ;
import { CommonModule } from "@angular/common" ;
import { BrowserModule } from "@angular/platform-browser" ;
import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
import { AppComponent } from "./app.component" ;
import { IgxBulletGraphModule } from "igniteui-angular-gauges" ;
@NgModule ({
bootstrap : [AppComponent],
declarations : [
AppComponent,
],
imports : [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
IgxBulletGraphModule
],
providers : [],
schemas : []
})
export class AppModule {}
ts コピー import { Component, OnInit, ViewChild } from "@angular/core" ;
import { IgxBulletGraphComponent } from "igniteui-angular-gauges" ;
@Component ({
standalone : false ,
selector : "app-root" ,
styleUrls : ["./app.component.scss" ],
templateUrl : "./app.component.html"
})
export class AppComponent implements OnInit {
@ViewChild ("bulletGraph" , { static : true })
public bulletGraph: IgxBulletGraphComponent;
public ngOnInit(): void {
}
}
ts コピー <div class ="container vertical" >
<igx-bullet-graph
#bulletGraph
height ="80px"
width ="400px"
value =70
targetValue =90
minimumValue =0
maximumValue =100
interval =10
labelInterval =10
labelExtent =0.025
labelsPreTerminal =0
labelsPostInitial =0
highlightValueDisplayMode ="Overlay"
highlightValue =25
>
</igx-bullet-graph >
</div >
html コピー
比較範囲
範囲はスケールで指定した値の範囲をハイライト表示する視覚的な要素です。その目的は、パフォーマンス バー メジャーの質的状態を視覚で伝えると同時に、その状態をレベルとして示すことにあります。
<igx-bullet-graph
height ="80px" width ="400px"
minimumValue =0 value =80 interval =10
maximumValue =100 targetValue =90
rangeBrushes ="#C62828, #F96232, #FF9800"
rangeOutlines ="#C62828, #F96232, #FF9800" >
<igx-linear-graph-range
startValue =0 endValue =40
innerStartExtent =0.075 innerEndExtent =0.075
outerStartExtent =0.95 outerEndExtent =0.95 >
</igx-linear-graph-range >
<igx-linear-graph-range
startValue =40 endValue =70
innerStartExtent =0.075 innerEndExtent =0.075
outerStartExtent =0.95 outerEndExtent =0.95 >
</igx-linear-graph-range >
<igx-linear-graph-range
startValue =70 endValue =100
innerStartExtent =0.075 innerEndExtent =0.075
outerStartExtent =0.95 outerEndExtent =0.95 >
</igx-linear-graph-range >
</igx-bullet-graph >
html
import { NgModule } from "@angular/core" ;
import { FormsModule } from "@angular/forms" ;
import { CommonModule } from "@angular/common" ;
import { BrowserModule } from "@angular/platform-browser" ;
import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
import { AppComponent } from "./app.component" ;
import { IgxBulletGraphModule } from "igniteui-angular-gauges" ;
@NgModule ({
bootstrap : [AppComponent],
declarations : [
AppComponent,
],
imports : [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
IgxBulletGraphModule
],
providers : [],
schemas : []
})
export class AppModule {}
ts コピー import { Component, ViewChild } from "@angular/core" ;
import { IgxBulletGraphComponent } from "igniteui-angular-gauges" ;
@Component ({
standalone : false ,
selector : "app-root" ,
styleUrls : ["./app.component.scss" ],
templateUrl : "./app.component.html"
})
export class AppComponent {
@ViewChild ("bulletGraph" , { static : true })
public bulletGraph: IgxBulletGraphComponent;
}
ts コピー <div class ="container vertical" >
<igx-bullet-graph
#bulletGraph
height ="80px" width ="400px"
minimumValue =0 value =80 interval =10
maximumValue =100 targetValue =90
rangeBrushes ="#C62828, #F96232, #FF9800"
rangeOutlines ="#C62828, #F96232, #FF9800" >
<igx-linear-graph-range
startValue =0 endValue =40
innerStartExtent =0.075 innerEndExtent =0.075
outerStartExtent =0.95 outerEndExtent =0.95 >
</igx-linear-graph-range >
<igx-linear-graph-range
startValue =40 endValue =70
innerStartExtent =0.075 innerEndExtent =0.075
outerStartExtent =0.95 outerEndExtent =0.95 >
</igx-linear-graph-range >
<igx-linear-graph-range
startValue =70 endValue =100
innerStartExtent =0.075 innerEndExtent =0.075
outerStartExtent =0.95 outerEndExtent =0.95 >
</igx-linear-graph-range >
</igx-bullet-graph >
</div >
html コピー
目盛
目盛は、ブレット グラフを読み取りやすくするために、目盛の間隔でスケールを分割して見せる役割を果たします。
主目盛 - 主目盛は、スケールの主要な区切りとして使用されます。表示間隔、範囲、およびスタイルは、対応するプロパティを設定し制御できます。
補助目盛 - 補助目盛は主目盛を補助し、スケールの数値を読み取りやすくするために追加して使用します。主目盛と同じ方法でカスタマイズできます。
<igx-bullet-graph
height ="80px" width ="400px"
minimumValue =0 value =70
maximumValue =100 targetValue =90
interval =10
tickBrush ="DodgerBlue"
ticksPreTerminal =0
ticksPostInitial =0
tickStrokeThickness =2
tickStartExtent =0.2
tickEndExtent =0.075
minorTickCount =4
minorTickBrush ="DarkViolet"
minorTickEndExtent =0.1
minorTickStartExtent =0.2
minorTickStrokeThickness =1 >
</igx-bullet-graph >
html
import { NgModule } from "@angular/core" ;
import { FormsModule } from "@angular/forms" ;
import { CommonModule } from "@angular/common" ;
import { BrowserModule } from "@angular/platform-browser" ;
import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
import { AppComponent } from "./app.component" ;
import { IgxBulletGraphModule } from "igniteui-angular-gauges" ;
@NgModule ({
bootstrap : [AppComponent],
declarations : [
AppComponent,
],
imports : [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
IgxBulletGraphModule
],
providers : [],
schemas : []
})
export class AppModule {}
ts コピー import { Component, ViewChild } from "@angular/core" ;
import { IgxBulletGraphComponent } from "igniteui-angular-gauges" ;
@Component ({
standalone : false ,
selector : "app-root" ,
styleUrls : ["./app.component.scss" ],
templateUrl : "./app.component.html"
})
export class AppComponent {
@ViewChild ("bulletGraph" , { static : true })
public bulletGraph: IgxBulletGraphComponent;
}
ts コピー <div class ="container vertical" >
<igx-bullet-graph
#bulletGraph
height ="80px" width ="400px"
minimumValue =0 value =70 interval =10
maximumValue =100 targetValue =90
tickBrush ="DodgerBlue"
ticksPreTerminal =0
ticksPostInitial =0
tickStrokeThickness =2
tickStartExtent =0.2
tickEndExtent =0.075
minorTickCount =4
minorTickBrush ="DarkViolet"
minorTickEndExtent =0.1
minorTickStartExtent =0.2
minorTickStrokeThickness =1 >
</igx-bullet-graph >
</div >
html コピー
ラベル
ラベルはスケールのメジャーを示します。
<igx-bullet-graph
height ="80px" width ="400px"
minimumValue =0 value =70 interval =10
maximumValue =100 targetValue =90
labelInterval =10
labelExtent =0.025
labelsPreTerminal =0
labelsPostInitial =0
fontBrush ="DodgerBlue"
font ="11px Verdana" >
</igx-bullet-graph >
html
import { NgModule } from "@angular/core" ;
import { FormsModule } from "@angular/forms" ;
import { CommonModule } from "@angular/common" ;
import { BrowserModule } from "@angular/platform-browser" ;
import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
import { AppComponent } from "./app.component" ;
import { IgxBulletGraphModule } from "igniteui-angular-gauges" ;
@NgModule ({
bootstrap : [AppComponent],
declarations : [
AppComponent,
],
imports : [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
IgxBulletGraphModule
],
providers : [],
schemas : []
})
export class AppModule {}
ts コピー import { Component, ViewChild } from "@angular/core" ;
import { IgxBulletGraphComponent } from "igniteui-angular-gauges" ;
@Component ({
standalone : false ,
selector : "app-root" ,
styleUrls : ["./app.component.scss" ],
templateUrl : "./app.component.html"
})
export class AppComponent {
@ViewChild ("bulletGraph" , { static : true })
public bulletGraph: IgxBulletGraphComponent;
}
ts コピー <div class ="container vertical" >
<igx-bullet-graph
#bulletGraph
height ="80px" width ="400px"
minimumValue =0 value =70 interval =10
maximumValue =100 targetValue =90
labelInterval =10
labelExtent =0.025
labelsPreTerminal =0
labelsPostInitial =0
fontBrush ="DodgerBlue"
font ="11px Verdana"
>
</igx-bullet-graph >
</div >
html コピー
バッキング
バッキング要素はブレット グラフ コントロールの背景と境界線を表します。常に最初に描画される要素でラベルやメモリなどの残りの要素は互いにオーバーレイします。
<igx-bullet-graph
height ="80px" width ="400px"
minimumValue =0 value =70 interval =10
maximumValue =100 targetValue =90
backingBrush ="#bddcfc"
backingOutline ="DodgerBlue"
backingStrokeThickness =4
backingInnerExtent =0
backingOuterExtent =1 >
</igx-bullet-graph >
html
import { NgModule } from "@angular/core" ;
import { FormsModule } from "@angular/forms" ;
import { CommonModule } from "@angular/common" ;
import { BrowserModule } from "@angular/platform-browser" ;
import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
import { AppComponent } from "./app.component" ;
import { IgxBulletGraphModule } from "igniteui-angular-gauges" ;
@NgModule ({
bootstrap : [AppComponent],
declarations : [
AppComponent,
],
imports : [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
IgxBulletGraphModule
],
providers : [],
schemas : []
})
export class AppModule {}
ts コピー import { Component, ViewChild } from "@angular/core" ;
import { IgxBulletGraphComponent } from "igniteui-angular-gauges" ;
@Component ({
standalone : false ,
selector : "app-root" ,
styleUrls : ["./app.component.scss" ],
templateUrl : "./app.component.html"
})
export class AppComponent {
@ViewChild ("bulletGraph" , { static : true })
public bulletGraph: IgxBulletGraphComponent;
}
ts コピー <div class ="container vertical" >
<igx-bullet-graph
#bulletGraph
height ="80px" width ="400px"
minimumValue =0 value =70 interval =10
maximumValue =100 targetValue =90
backingBrush ="#bddcfc"
backingOutline ="DodgerBlue"
backingStrokeThickness =4
backingInnerExtent =0
backingOuterExtent =1
>
</igx-bullet-graph >
</div >
html コピー
スケール
スケールはゲージで値の全範囲をハイライト表示する視覚的な要素です。外観やスケールの図形のカスタマイズ、更にスケールを反転 (isScaleInverted
プロパティを使用) させて、すべてのラベルを左から右ではなく、右から左へ描画することもできます。
<igx-bullet-graph
height ="80px" width ="400px"
minimumValue =0 value =70 interval =10
maximumValue =100 targetValue =90
isScaleInverted =false
scaleBackgroundBrush ="DodgerBlue"
scaleBackgroundOutline ="DarkViolet"
scaleBackgroundThickness =2
scaleStartExtent =0.05
scaleEndExtent =0.95 >
</igx-bullet-graph >
html
import { NgModule } from "@angular/core" ;
import { FormsModule } from "@angular/forms" ;
import { CommonModule } from "@angular/common" ;
import { BrowserModule } from "@angular/platform-browser" ;
import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
import { AppComponent } from "./app.component" ;
import { IgxBulletGraphModule } from "igniteui-angular-gauges" ;
@NgModule ({
bootstrap : [AppComponent],
declarations : [
AppComponent,
],
imports : [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
IgxBulletGraphModule
],
providers : [],
schemas : []
})
export class AppModule {}
ts コピー import { Component, ViewChild } from "@angular/core" ;
import { IgxBulletGraphComponent } from "igniteui-angular-gauges" ;
@Component ({
standalone : false ,
selector : "app-root" ,
styleUrls : ["./app.component.scss" ],
templateUrl : "./app.component.html"
})
export class AppComponent {
@ViewChild ("bulletGraph" , { static : true })
public bulletGraph: IgxBulletGraphComponent;
}
ts コピー <div class ="container vertical" >
<igx-bullet-graph
#bulletGraph
height ="80px" width ="400px"
minimumValue =0 value =70 interval =10
maximumValue =100 targetValue =90
isScaleInverted =false
scaleBackgroundBrush ="DodgerBlue"
scaleBackgroundOutline ="Red"
scaleBackgroundThickness =2
scaleStartExtent =0.05
scaleEndExtent =0.95 >
</igx-bullet-graph >
</div >
html コピー
まとめ
上記すべてのコード スニペットを以下のコード ブロックにまとめています。プロジェクトに簡単にコピーしてブレットグラフのすべての機能を再現できます。
<igx-bullet-graph
height ="80px" width ="400px"
minimumValue =0
maximumValue =100
isScaleInverted =false
scaleBackgroundBrush ="Gray"
scaleBackgroundOutline ="Gray"
scaleBackgroundThickness =2
scaleStartExtent =0.05
scaleEndExtent =0.95
value =50
valueBrush ="Black"
valueStrokeThickness =1
valueInnerExtent =0.5
valueOuterExtent =0.65
targetValue =80
targetValueBreadth =7.5
targetValueBrush ="Black"
targetValueOutline ="Black"
targetValueStrokeThickness =1
targetValueInnerExtent =0.3
targetValueOuterExtent =0.85
labelInterval =10
labelExtent =0.025
labelsPreTerminal =0
labelsPostInitial =0
fontBrush ="Black"
font ="11px Verdana"
backingBrush ="#cecece"
backingOutline ="#cecece"
backingStrokeThickness =4
backingInnerExtent =0
backingOuterExtent =1
interval =10
tickBrush ="Black"
ticksPreTerminal =0
ticksPostInitial =0
tickStrokeThickness =2
tickStartExtent =0.2
tickEndExtent =0.075
minorTickCount =4
minorTickBrush ="Black"
minorTickEndExtent =0.1
minorTickStartExtent =0.2
minorTickStrokeThickness =1
rangeBrushes ="#C62828, #F96232, #FF9800"
rangeOutlines ="#C62828, #F96232, #FF9800" >
<igx-linear-graph-range
startValue =20 endValue =40
innerStartExtent =0.25 innerEndExtent =0.25
outerStartExtent =0.9 outerEndExtent =0.9 >
</igx-linear-graph-range >
<igx-linear-graph-range
startValue =40 endValue =60
innerStartExtent =0.25 innerEndExtent =0.25
outerStartExtent =0.9 outerEndExtent =0.9 >
</igx-linear-graph-range >
<igx-linear-graph-range
startValue =60 endValue =90
innerStartExtent =0.25 innerEndExtent =0.25
outerStartExtent =0.9 outerEndExtent =0.9 >
</igx-linear-graph-range >
</igx-bullet-graph >
html
API リファレンス
以下は上記のセクションで説明した API メンバーのリストです。
その他のリソース
その他のゲージ タイプの詳細については、以下のトピックを参照してください。