Web Components 선형 계기 개요
The Ignite UI for Web Components linear gauge component allows for visualizing data in the form of a linear gauge. The IgcLinearGaugeComponent provides a simple and concise view of a value compared against a scale and one or more ranges. It supports one scale, one set of tick marks and one set of labels. The component has also a built-in support for animated transitions. This animation is easily customizable by setting the transitionDuration property. The features of the linear gauge component include configurable orientation and direction, configurable visual elements such as the needle, and more.
Web Components Linear Gauge Example
The following sample demonstrates how setting multiple properties on the same IgcLinearGaugeComponent can transform it to completely different linear gauge.
Dependencies
Web Components 게이지 구성 요소를 설치할 때 핵심 패키지도 설치해야 합니다.
npm install --save igniteui-webcomponents-core
npm install --save igniteui-webcomponents-gauges
Component Modules
The IgcLinearGaugeComponent requires the following modules:
import { IgcLinearGaugeModule } from 'igniteui-webcomponents-gauges';
ModuleManager.register(
IgcLinearGaugeModule
);
Usage
다음 코드는 바늘과 눈금의 세 가지 비교 범위를 포함하는 선형 게이지를 만드는 방법을 보여줍니다.
<igc-linear-gauge
height="80px" width="400px"
minimum-value=5 value=43
maximum-value=55>
<igc-linear-graph-range
start-value=0
end-value=15
brush="red">
</igc-linear-graph-range>
<igc-linear-graph-range
start-value=50
end-value=30
brush="yellow">
</igc-linear-graph-range>
<igc-linear-graph-range
start-value=30
end-value=55
brush="green">
</igc-linear-graph-range>
</igc-linear-gauge>
Needle
이는 선형 게이지 구성 요소에 의해 표시되는 기본 측정값이며 막대로 시각화되거나 아래에 설명된 대로 거의 모든 모양을 표시하도록 사용자 정의할 수 있습니다.
<igc-linear-gauge
height="80px" width="400px"
minimum-value=0
maximum-value=100
interval=10
value=50
is-needle-dragging-enabled=true
needle-shape="Custom"
needle-brush="DodgerBlue"
needle-out-line="DodgerBlue"
needle-stroke-thickness=1
needle-breadth=15
needle-inner-extent=0.35
needle-outer-extent=0.65
needle-outer-point-extent=0.8
needle-inner-point-extent=0.325
needle-inner-point-width=0
needle-outer-point-width=0.3
needle-inner-base-width=0
needle-outer-base-width=0.07>
</igc-linear-gauge>
Highlight Needle
The linear gauge can be modified to show a second needle. This will make the main needle's value appear with a lower opacity. To enable this first set highlightValueDisplayMode to Overlay and then apply a highlightValue.
<igc-linear-gauge
id="gauge"
height="80px"
width="100%"
minimum-value="0"
maximum-value="100"
value="75"
interval="10"
label-interval="10"
label-extent="0.025"
labels-pre-terminal="0"
labels-post-initial="0"
needle-brush="blue"
highlight-value-display-mode="Overlay"
highlight-value=25
is-highlight-needle-dragging-enabled=true>
</igc-linear-gauge>
Ranges
범위는 눈금에서 지정된 값 범위를 강조 표시하는 시각적 요소입니다. 그 목적은 성능 막대 측정값의 질적 상태를 시각적으로 전달하는 동시에 해당 상태 내에 있는 정도를 보여주는 것입니다.
<igc-linear-gauge
height="80px" width="400px"
minimum-value=0 value=50
maximum-value=100 interval=10
range-brushes="#a4bd29, #F86232"
range-outlines="#a4bd29, #F86232" >
<igc-linear-graph-range
start-value=0 end-value=50
inner-start-extent=0.075 inner-end-extent=0.075
outer-start-extent=0.25 outer-end-extent=0.4>
</igc-linear-graph-range>
<igc-linear-graph-range
start-value=50 end-value=100
inner-start-extent=0.075 inner-end-extent=0.075
outer-start-extent=0.4 outer-end-extent=0.55>
</igc-linear-graph-range>
</igc-linear-gauge>
Tick Marks
눈금 표시는 선형 게이지의 가독성을 높이기 위해 눈금을 간격으로 시각적으로 나누는 역할을 합니다.
주요 눈금 표시 – 주요 눈금 표시는 눈금의 기본 구분 기호로 사용됩니다. 나타나는 빈도, 범위 및 스타일은 해당 속성을 설정하여 제어할 수 있습니다.
보조 눈금 표시 – 보조 눈금 표시는 눈금의 가독성을 추가로 향상시키는 데 사용될 수 있고 주요 눈금과 유사한 방식으로 사용자 정의할 수 있는 보조 눈금 표시를 나타냅니다.
<igc-linear-gauge
height="80px" width="400px"
minimum-value=0 value=50
maximum-value=100
interval=10
tick-brush="DodgerBlue"
ticks-pre-terminal=0
ticks-post-initial=0
tick-stroke-thickness=2
tick-start-extent=0.25
tick-end-extent=0.05
minor-tick-count=4
minor-tick-brush="DarkViolet"
minor-tick-end-extent=0.05
minor-tick-start-extent=0.15
minor-tick-stroke-thickness=1>
</igc-linear-gauge>
Labels
레이블은 척도의 측정값을 나타냅니다.
<igc-linear-gauge
height="80px" width="400px"
minimum-value=0 value=50
maximum-value=100 interval=10
label-interval=10
label-extent=0.025
labels-pre-terminal=0
labels-post-initial=0
font-brush="DodgerBlue"
font="11px Verdana">
</igc-linear-gauge>
Backing
뒷면 요소는 선형 게이지 구성 요소의 배경과 테두리를 나타냅니다. 이는 항상 렌더링되는 첫 번째 요소이며 레이블 및 눈금 표시와 같은 나머지 모든 요소는 그 위에 오버레이됩니다.
<igc-linear-gauge
height="80px" width="400px"
minimum-value=0 value=20
maximum-value=100 interval=10
backing-brush="#bddcfc"
backing-outline="DodgerBlue"
backing-stroke-thickness=4
backing-inner-extent=0
backing-outer-extent=1>
</igc-linear-gauge>
Scale
The scale is a visual element that highlights the full range of values in the linear gauge. You can customize the appearance and the shape of the scale. It can also be inverted (using isScaleInverted property) and all labels will be rendered from right-to-left instead of left-to-right.
<igc-linear-gauge
height="80px" width="400px"
minimum-value=0 value=50
maximum-value=100 interval=10
isScale-inverted=false
scale-brush="DodgerBlue"
scale-outline="DarkViolet"
scale-stroke-thickness=1
scale-inner-extent=0.05
scale-outer-extent=0.65
scale-start-extent=0.05
scale-end-extent=0.95>
</igc-linear-gauge>
Summary
편의를 위해 위의 모든 코드 조각은 아래의 하나의 코드 블록으로 결합되어 프로젝트에 쉽게 복사하고 모든 기능과 시각적 개체가 활성화된 선형 게이지를 볼 수 있습니다.
<igc-linear-gauge id="lineargauge"
height="80px" width="400px"
minimum-value=0
maximum-value=100
label-interval=10
label-extent=0.025
labels-pre-terminal=0
labels-post-initial=0
font-brush="Black"
font="11px Verdana"
interval=10
tick-brush="Black"
ticks-pre-terminal=0
ticks-post-initial=0
tick-stroke-thickness=2
tick-start-extent=0.25
tick-end-extent=0.05
minor-tick-count=4
minor-tick-brush="Black"
minor-tick-end-extent=0.05
minor-tick-start-extent=0.15
minor-tick-stroke-thickness=1
value=50
is-needle-dragging-enabled=true
needle-shape="Custom"
needle-brush="Black"
needle-outline="Black"
needle-stroke-thickness=1
needle-breadth=15
needle-inner-extent=0.35
needle-outer-extent=0.65
needle-outer-point-extent=0.8
needle-inner-point-extent=0.325
needle-inner-point-width=0
needle-outer-point-width=0.3
needle-inner-base-width=0
needle-outer-base-width=0.07
is-scale-inverted=false
scale-brush="Gray"
scale-outline="Gray"
scale-stroke-thickness=1
scale-inner-extent=0.05
scale-outer-extent=0.65
scale-start-extent=0.05
scale-end-extent=0.95
backing-brush="#cecece"
backing-outline="#cecece"
backing-stroke-thickness=4
backing-inner-extent=0
backing-outer-extent=1
range-brushes ="#C62828, #F96232, #FF9800"
range-outlines="#C62828, #F96232, #FF9800">
<igc-linear-graph-range
start-value=0 end-Value=50
inner-start-extent=0.075 inner-end-extent=0.075
outer-start-extent=0.25 outer-end-extent=0.4>
</igc-linear-graph-range>
<igc-linear-graph-range
start-value=50 end-value=100
inner-start-extent=0.075 inner-end-extent=0.075
outer-start-extent=0.4 outer-end-extent=0.55>
</igc-linear-graph-range>
</igc-linear-gauge>
API References
다음은 위 섹션에서 언급된 API 멤버 목록입니다.
Additional Resources
다음 주제에서 다른 유형의 게이지에 대한 자세한 정보를 찾을 수 있습니다.