Web Components 방사형 게이지 구성 요소는 미리 정의된 모양과 눈금을 만들기 위해 바늘, 눈금 표시, 범위 및 레이블과 같은 다양한 시각적 요소를 제공합니다. IgcRadialGaugeComponent 또한 애니메이션 전환에 대한 지원이 내장되어 있습니다. 이 애니메이션은 속성을 설정하여 쉽게 사용자 지정할 수 있습니다 transitionDuration.
<!DOCTYPE html><html><head><title>RadialGaugeBacking</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><igc-radial-gaugebacking-shape="Fitted"backing-brush="#fcfcfc"backing-outline="DodgerBlue"backing-oversweep="5"backing-corner-radius="10"backing-stroke-thickness="5"backing-outer-extent="0.8"backing-inner-extent="0.15"scale-start-angle="135"scale-end-angle="45"scale-brush="#dddddd"height="100%"width="100%"minimum-value="0"value="50"maximum-value="80"interval="10" /></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
<!DOCTYPE html><html><head><title>RadialGaugeScale</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><igc-radial-gaugescale-start-angle="135"scale-end-angle="45"scale-brush="DodgerBlue"scale-sweep-direction="Clockwise"scale-oversweep="1"scale-oversweep-shape="Fitted"scale-start-extent="0.45"scale-end-extent="0.575"height="100%"width="100%"minimum-value="0"value="50"maximum-value="80"interval="10" ></igc-radial-gauge></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
Labels and Titles
방사형 게이지 레이블은 minimumValue과 maximumValue 속성 값 사이의 지정된 간격으로 숫자 값을 표시하는 시각적 요소입니다. labelExtent 속성을 분수로 설정하여 레이블 위치를 지정할 수 있습니다. 여기서 0은 게이지 중심을 나타내고 1은 게이지 뒷면의 외부 범위를 나타냅니다. 또한, fontBrush 및 font과 같은 다양한 스타일 속성을 설정하여 레이블을 사용자 정의할 수 있습니다.
<!DOCTYPE html><html><head><title>RadialGaugeLabels</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><igc-radial-gaugeid="gauge"font-brush="DodgerBlue"font="20px Verdana"label-interval="10"label-extent="0.65"labels-pre-terminal="0"labels-post-initial="0"title-displays-value=truesubtitle-text="MPH"height="100%"width="100%"minimum-value="0"value="50"maximum-value="80"interval="10" ></igc-radial-gauge></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
방사형 게이지의 레이블과 제목은 배율을 변경할 수 있습니다. 이 기능을 사용하려면 먼저 true로 설정합니다 opticalScalingEnabled. 그런 다음 레이블이 100% 광학 배율을 갖는 크기를 관리하는 항목을 설정할 opticalScalingSize 수 있습니다. 레이블은 게이지의 크기가 더 클 때 더 큰 글꼴을 갖습니다. 예를 들어, 이 속성이 500으로 설정되고 게이지 px 크기가 예를 들어 두 배가 되면 레이블의 글꼴 크기가 200% 더 커집니다. 1000.
EXAMPLE
TS
HTML
CSS
import { IgcRadialGaugeModule } from'igniteui-webcomponents-gauges';
import { IgcRadialGaugeComponent } from'igniteui-webcomponents-gauges';
import { ModuleManager } from'igniteui-webcomponents-core';
ModuleManager.register(IgcRadialGaugeModule);
exportclassRadialGaugeOpticalScaling{
private gauge: IgcRadialGaugeComponent;
constructor() {
this.onGaugeSizeChanged = this.onGaugeSizeChanged.bind(this);
this.gauge = document.getElementById('gauge') as IgcRadialGaugeComponent;
let checkbox1 = document.getElementById('checkbox1');
checkbox1!.addEventListener('change', this.onOpticalScalingChanged);
let slider1 = document.getElementById('slider') as HTMLInputElement;
slider1!.addEventListener('change', this.onGaugeSizeChanged);
}
public onOpticalScalingChanged = (e: any) => {
const isEnabled = e.target.checked;
this.gauge.opticalScalingEnabled = isEnabled;
if (isEnabled) {
this.gauge.opticalScalingEnabled = true;
}
else {
this.gauge.opticalScalingEnabled = false;
}
}
public onGaugeSizeChanged = (e: any) => {
let num: number = parseInt(e.target.value);
this.gauge.width = num.toString() + "%";
this.gauge.height = num.toString() + "%";
}
}
new RadialGaugeOpticalScaling();
ts
<!DOCTYPE html><html><head><title>RadialGaugeOpticalScaling</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><divclass="options horizontal"><labelclass="options-label">Optical Scaling: </label><labelclass="options-label"><inputtype="checkbox"id="checkbox1"checked="true"></input> Resize Gauge: </label><inputclass="options-slider"id="slider"type="range"min="20"max="100"step="10"value="100"></input></div><igc-radial-gaugeid="gauge"height="100%"width="100%"title-displays-value="true"subtitle-text="MPH"minimum-value="0"value="50"maximum-value="80"interval="10"title-extent="0.5"subtitle-extent="0.65"optical-scaling-enabled="true"optical-scaling-size="500"></igc-radial-gauge></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
<!DOCTYPE html><html><head><title>RadialGaugeTickmarks</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><igc-radial-gaugeid="gauge"height="100%"width="100%"minimum-vue="0"value="50"maximum-value="80"interval="10"tick-start-extent="0.5"tick-end-extent="0.57"tick-stroke-thickness="2"tick-brush="DodgerBlue"minor-tick-count="4"minor-tick-end-extent="0.520"minor-tick-start-extent="0.57"minor-tick-stroke-thickness="1"minor-tick-brush="DarkViolet" ></igc-radial-gauge></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
<!DOCTYPE html><html><head><title>RadialGaugeRanges</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><igc-radial-gaugeheight="100%"width="100%"minimum-value="0"value="50"maximum-value="80"interval="10"range-brushes ="#a4bd29, #F86232"range-outlines="#a4bd29, #F86232" ><igc-radial-gauge-rangename="range1"start-value="10"end-value="25"inner-start-extent="0.50"inner-end-extent="0.50"outer-start-extent="0.57"outer-end-extent="0.57" ></igc-radial-gauge-range><igc-radial-gauge-rangename="range2"start-value="25"end-value="40"inner-start-extent="0.50"inner-end-extent="0.50"outer-start-extent="0.57"outer-end-extent="0.57" ></igc-radial-gauge-range></igc-radial-gauge></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
Needle
방사형 게이지 바늘은 게이지 설정 값을 나타내는 데 사용되는 시각적 요소입니다. 바늘은 미리 정의된 여러 모양 중 하나로 제공됩니다. 바늘은 게이지 중앙에 위치하는 피벗 모양을 가질 수 있습니다. 또한 피벗 모양은 미리 정의된 모양 중 하나를 사용합니다. 오버레이 또는 언더레이를 포함하는 피벗 모양에는 모양에 적용되는 별도의 피벗 브러시가 있을 수 있습니다.
<!DOCTYPE html><html><head><title>RadialGaugeNeedle</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><igc-radial-gaugeheight="100%"width="100%"is-needle-dragging-enabled="true"is-needle-dragging-constrained="true"needle-shape="NeedleWithBulb"needle-brush="DodgerBlue"needle-outline="DodgerBlue"needle-end-extent="0.475"needle-stroke-thickness="1"needle-pivot-shape="CircleOverlay"needle-pivot-brush="#9f9fa0"needle-pivot-outline="#9f9fa0"needle-pivot-width-ratio="0.2"needle-pivot-stroke-thickness="1"value="50"minimum-value="0"maximum=value="80"interval="10" ></igc-radial-gauge></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
<!DOCTYPE html><html><head><title>RadialGaugeHighlightNeedle</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png" ><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><igc-radial-gaugeid="gauge"highlight-value="50"highlight-value-display-mode="Overlay"highlight-label-displays-value="true"highlight-label-snaps-to-needle-pivot="true"is-highlight-needle-dragging-enabled="true"label-interval="10"label-extent="0.65"height="100%"width="100%"minimum-value="0"value="30"maximum-value="100"interval="10" ></igc-radial-gauge></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
Summary
편의를 위해 위의 모든 코드 조각은 아래의 하나의 코드 블록으로 결합되어 프로젝트에 쉽게 복사하고 모든 기능과 시각적 개체가 활성화된 방사형 게이지를 볼 수 있습니다.