Blazor リニア ゲージの概要

    Ignite UI for Blazor リニア ゲージ コンポーネントを使用すると、リニア ゲージの形式でデータを視覚化できます。IgbLinearGauge は、スケールおよび 1 つ以上の範囲と比較した値のシンプルで簡潔なビューを提供します。1 つのスケール、1 セットの目盛り、および 1 セットのラベルをサポートします。このコンポーネントには、アニメーション化されたトランジションのサポートも組み込まれており、アニメーションでは、TransitionDuration プロパティの設定で簡単にカスタマイズできます。また構成可能な向きや方向、視覚要素やツールチップなどがサポートされます。

    Blazor リニア ゲージの例

    以下のサンプルは、同じ IgbLinearGauge でいくつかのプロパティを設定して全く異なるゲージにする方法を示します。

    モジュールの要件

    IgbLinearGauge を作成するには、以下のモジュールが必要です。

    // in Program.cs file
    
    builder.Services.AddIgniteUIBlazor(typeof(IgbLinearGaugeModule));
    

    使用方法

    以下のコードは針およびスケールで 3 つの比較範囲を含むリニア ゲージを作成する方法を紹介します。

    <IgbLinearGauge Height="80px" Width="100%"
            MinimumValue="5"
            MaximumValue="55"
            Value="43" >
        <IgbLinearGraphRange StartValue="0"
                EndValue="15"
                Brush="red" >
        </IgbLinearGraphRange>
         <IgbLinearGraphRange StartValue="15"
                EndValue="30"
                Brush="yellow">
        <IgbLinearGraphRange StartValue="30"
                EndValue="55"
                Brush="green">
        </IgbLinearGraphRange>
    </IgbLinearGauge>
    

    これは、コンポーネントで表示されるプライマリ メジャーでバーで可視化されます。あるいは以下で示す図形のほとんどすべてをカスタマイズすることもできます。

    <IgbLinearGauge Height="80px" Width="100%"
        MinimumValue="0" Value="50"
        MaximumValue="100" Interval="10"
        IsNeedleDraggingEnabled="true"
        NeedleShape="LinearGraphNeedleShape.Custom"
        NeedleBrush="DodgerBlue"
        NeedleOutline="DodgerBlue"
        NeedleStrokeThickness="1"
        NeedleBreadth="15"
        NeedleInnerExtent="0.35"
        NeedleOuterExtent="0.65"
        NeedleOuterPointExtent="0.8"
        NeedleInnerPointExtent="0.325"
        NeedleInnerPointWidth="0"
        NeedleOuterPointWidth="0.3"
        NeedleInnerBaseWidth="0"
        NeedleOuterBaseWidth="0.07">
    </IgbLinearGauge>
    

    範囲

    範囲はスケールで指定した値の範囲を強調表示する視覚的な要素です。その目的は、パフォーマンス バー メジャーの質的状態を視覚で伝えると同時に、その状態をレベルとして示すことにあります。

    <IgbLinearGauge Height="80px" Width="100%"
            MinimumValue="0" Value="50"
            MaximumValue="100" Interval="10"
            RangeBrushes="#A4BD29, #F86232"
            RangeOutlines="#A4BD29, #F86232">
        <IgbLinearGraphRange StartValue="0"
                EndValue="50"
                InnerStartExtent="0.075"
                InnerEndExtent="0.075"
                OuterStartExtent="0.25"
                OuterEndExtent="0.4">
        </IgbLinearGraphRange>
        <IgbLinearGraphRange StartValue="50"
                EndValue="100"
                InnerStartExtent="0.075"
                InnerEndExtent="0.075"
                OuterStartExtent="0.4"
                OuterEndExtent="0.55">
        </IgbLinearGraphRange>
    </IgbLinearGauge>
    

    目盛

    目盛は、リニア ゲージを読み取りやすくするために、目盛の間隔でスケールを分割して見せる役割を果たします。

    主目盛 - 主目盛は、スケールの主要な区切りとして使用されます。表示間隔、範囲、およびスタイルは、対応するプロパティを設定し制御できます。

    補助目盛 - 補助目盛は主目盛を補助し、スケールの数値を読み取りやすくするために追加して使用します。主目盛と同じ方法でカスタマイズできます。

     <IgbLinearGauge Height="80px" Width="100%"
        MinimumValue="0" Value="50"
        MaximumValue="100" Interval="10"
        TickBrush="DodgerBlue"
        TicksPreTerminal="0"
        TicksPostInitial="0"
        TickStrokeThickness="2"
        TickStartExtent="0.25"
        TickEndExtent="0.05"
        MinorTickCount="4"
        MinorTickBrush="DarkViolet"
        MinorTickEndExtent="0.05"
        MinorTickStartExtent="0.15"
        MinorTickStrokeThickness="1">
    </IgbLinearGauge>
    

    ラベル

    ラベルはスケールのメジャーを示します。

    <IgbLinearGauge Height="80px" Width="100%"
        MinimumValue="0" Value="50"
        MaximumValue="100" Interval="10"
        LabelInterval="10"
        LabelExtent="0.025"
        LabelsPreTerminal="0"
        LabelsPostInitial="0"
        FontBrush="DodgerBlue"
        Font="11px Verdana">
    </IgbLinearGauge>
    

    バッキング

    バッキング要素はブレット グラフ コントロールの背景と境界線を表します。常に最初に描画される要素でラベルやメモリなどの残りの要素は互いにオーバーレイします。

    <IgbLinearGauge Height="80px" Width="100%"
        MinimumValue="0"
        MaximumValue="100"
        Value="50"
        Interval="10"
        BackingBrush="#BDDCFC"
        BackingOutline="DodgerBlue"
        BackingStrokeThickness="4"
        BackingInnerExtent="0"
        BackingOuterExtent="1">
    </IgbLinearGauge>
    

    スケール

    スケールはゲージで値の全範囲を強調表示する視覚的な要素です。外観やスケールの図形のカスタマイズ、更にスケールを反転 (IsScaleInverted プロパティを使用) させて、すべてのラベルを左から右ではなく、右から左へ描画することもできます。

    <IgbLinearGauge Height="80px" Width="100%"
        MinimumValue="0" Value="50"
        MaximumValue="100" Interval="10"
        IsScaleInverted="false"
        ScaleBrush="DodgerBlue"
        ScaleOutline="Red"
        ScaleStrokeThickness="2"
        ScaleInnerExtent="0.05"
        ScaleOuterExtent="0.65"
        ScaleStartExtent="0.05"
        ScaleEndExtent="0.95">
    </IgbLinearGauge>
    

    まとめ

    上記すべてのコード スニペットを以下のコード ブロックにまとめています。プロジェクトに簡単にコピーしてブレットグラフのすべての機能を再現できます。

    <IgbLinearGauge Height="80px" Width="100%"
            MinimumValue="0"
            MaximumValue="100"
    
            LabelInterval="10"
            LabelExtent="0.025"
            LabelsPreTerminal="0"
            LabelsPostInitial="0"
            FontBrush="DodgerBlue"
            Font="11px Verdana"
    
            Interval="10"
            TickBrush="DodgerBlue"
            TicksPreTerminal="0"
            TicksPostInitial="0"
            TickStrokeThickness="2"
            TickStartExtent="0.25"
            TickEndExtent="0.05"
    
            MinorTickCount="4"
            MinorTickBrush="DarkViolet"
            MinorTickEndExtent="0.05"
            MinorTickStartExtent="0.15"
            MinorTickStrokeThickness="1"
            Value="50"
            MaximumValue="100" Interval="10"
            IsNeedleDraggingEnabled="true"
            NeedleShape="LinearGraphNeedleShape.Custom"
            NeedleBrush="DodgerBlue"
            NeedleOutline="DodgerBlue"
            NeedleStrokeThickness="1"
            NeedleBreadth="15"
            NeedleInnerExtent="0.35"
            NeedleOuterExtent="0.65"
            NeedleOuterPointExtent="0.8"
            NeedleInnerPointExtent="0.325"
            NeedleInnerPointWidth="0"
            NeedleOuterPointWidth="0.3"
            NeedleInnerBaseWidth="0"
            NeedleOuterBaseWidth="0.07"
    
            IsScaleInverted="false"
            ScaleBrush="DodgerBlue"
            ScaleOutline="Red"
            ScaleStrokeThickness="2"
            ScaleInnerExtent="0.05"
            ScaleOuterExtent="0.65"
            ScaleStartExtent="0.05"
            ScaleEndExtent="0.95"
    
            BackingBrush="#BDDCFC"
            BackingOutline="DodgerBlue"
            BackingStrokeThickness="4"
            BackingInnerExtent="0"
            BackingOuterExtent="1"
    
            RangeBrushes="#A4BD29, #F86232"
            RangeOutlines="#A4BD29, #F86232">
        <IgbLinearGraphRange StartValue="0"
                    EndValue="50"
                    InnerStartExtent="0.075"
                    InnerEndExtent="0.075"
                    OuterStartExtent="0.25"
                    OuterEndExtent="0.4">
        </IgbLinearGraphRange>
        <IgbLinearGraphRange StartValue="50"
                    EndValue="100"
                    InnerStartExtent="0.075"
                    InnerEndExtent="0.075"
                    OuterStartExtent="0.4"
                    OuterEndExtent="0.55">
        </IgbLinearGraphRange>
    </IgbLinearGauge>
    

    API リファレンス

    以下は上記のセクションで説明した API メンバーのリストです。

    その他のリソース

    その他のゲージ タイプの詳細については、以下のトピックを参照してください。