製品版のみの機能
リニア ゲージ - スケール設定
このサンプルでは、igLinearGauge コントロールのサポートされるスケール構成を紹介します。
このサンプルは CTP 機能を使用しています。製品版では、API や動作が変更される場合があります。
健康的な食事
脂質
炭水化物
たんぱく質
脂質、炭水化物、たんぱく質の合計カロリーの比率。中の範囲は健康的な食事の比率です。目標値が設定されています。
このサンプルは、より大きい画面サイズのためにデザインされました。
モバイル デバイスで画面を回転、フル サイズ表示、またはその他のデバイスにメールで送信します。
このサンプルでは、igLinearGauge コントロールのサポートされるスケール構成を紹介します。
コード ビュー
クリップボードへコピー
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Ignite UI for jQuery Required Combined CSS Files -->
<link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
<link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/structure/infragistics.css" rel="stylesheet" />
<!-- Used to style the API Viewer and Explorer UI -->
<link href="/css/apiviewer.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<!-- Ignite UI for jQuery Required Combined JavaScript Files -->
<script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.core.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.dv.js"></script>
</head>
<body>
<div style="min-height:50px" >
<h3>健康的な食事</h3>
</div>
<br />
<div >
<div style="width:30%" >
脂質
</div>
<div style="width:70%" id="lineargauge1">
</div>
</div>
<br />
<div>
<div style="width:30%">
炭水化物
</div>
<div style="width:70%" id="lineargauge2">
</div>
</div>
<br />
<div>
<div style="width:30%" >
たんぱく質
</div>
<div style="width:70%" id="lineargauge3">
</div>
</div>
<br />
脂質、炭水化物、たんぱく質の合計カロリーの比率。中の範囲は健康的な食事の比率です。目標値が設定されています。
<script type="text/javascript">
$(function () {
var $linearGauge = $("#lineargauge1");
$linearGauge.igLinearGauge({
width: '100%',
height: '80px',
ranges: [
{
brush: '#FDB881',
name: 'bad',
startValue: 0,
endValue: 20
},
{
brush: '#F18B36',
name: 'acceptable',
startValue: 20,
endValue: 35
},
{
brush: '#D2660D',
name: 'good',
startValue: 35,
endValue: 100
}
],
value: 40,
needleStrokeThickness: 2,
formatLabel: function (evt, ui) {
ui.label += "%";
}
});
var $linearGauge2 = $("#lineargauge2");
$linearGauge2.igLinearGauge({
width: '100%',
height: '80px',
ranges: [
{
brush: '#ABD652',
name: 'bad',
startValue: 0,
endValue: 45
},
{
brush: '#739F19',
name: 'acceptable',
startValue: 45,
endValue: 65
},
{
brush: '#527211',
name: 'good',
startValue: 65,
endValue: 100
}
],
value: 35,
labelExtent: 0.76,
tickStartExtent: 0.5,
minorTickEndExtent: 0.54,
minorTickStartExtent: 0.65,
needleStrokeThickness: 2,
formatLabel: function (evt, ui) {
ui.label += "%";
}
});
var $linearGauge3 = $("#lineargauge3");
$linearGauge3.igLinearGauge({
width: '100%',
height: '80px',
ranges: [
{
name: 'bad',
startValue: 0,
endValue: 10
},
{
name: 'acceptable',
startValue: 10,
endValue: 35
},
{
name: 'good',
startValue: 35,
endValue: 100
}
],
value: 25,
labelExtent: 0.76,
tickBrush: '#F79646',
minorTickBrush: '#F79646',
fontBrush: '#11719A',
ticksPreTerminal: 10,
ticksPostInitial: 10,
labelsPostInitial: 20,
labelsPreTerminal: 20,
formatLabel: function (evt, ui) {
ui.label = ui.value + "%";
}
});
});
</script>
</body>
</html>