Blazor Bullet Graph Overview

    The Blazor bullet graph component allows for a linear and concise view of measures compared against a scale.

    The Ignite UI for Blazor bullet graph component provides you with the ability to create attractive data presentations, replacing meters and gauges that are used on dashboards with simple yet straightforward and clear bar charts. A bullet graph is one of the most effective and efficient ways to present progress towards goals, good/better/best ranges, or compare multiple measurements in as little horizontal or vertical space as possible.

    Blazor Bullet Graph Example

    The following sample demonstrates how setting multiple properties on the same IgbBulletGraph can transform it to completely different bullet graph.

    The bullet graph supports one scale, one set of tick marks and one set of labels. The bullet graph component also has built-in support for animated transitions. This animation is easily customizable by setting the TransitionDuration property. The features of the bullet graph include configurable orientation and direction, configurable visual elements such as the needle, and more.

    Required Modules

    The IgbBulletGraph requires the following modules:

    IgbBulletGraphModule.Register(IgniteUIBlazor);
    

    Usage

    The following code walks through creating a bullet graph component, and configuring a performance bar, comparative measure marker, and three comparative ranges on the scale.

    <IgbBulletGraph Height="80px" Width="100%"
    MinimumValue="5" Value="35"
    MaximumValue="55" TargetValue="43">
    <IgbLinearGraphRange StartValue="0"
      EndValue="15"
      Brush="#828181" />
    <IgbLinearGraphRange StartValue="15"
      EndValue="30"
      Brush="#AAAAAA" />
    <IgbLinearGraphRange StartValue="30"
      EndValue="55"
      Brush="#D0D0D0" />
    </IgbBulletGraph>
    

    Comparative Measures

    The bullet graph can show two measures: performance value and target value.

    Performance value is the primary measure displayed by the component and it is visualized as a bar that stretches along the length of the whole graph. The target value is a measure which the performance value compares against. It is displayed as a small block that runs perpendicular to the orientation of the performance bar.

    <IgbBulletGraph Height="80px" Width="100%"
        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">
    </IgbBulletGraph>
    

    Comparative Ranges

    The ranges are visual elements that highlight a specified range of values on a scale. Their purpose is to visually communicate the qualitative state of the performance bar measure, illustrating at the same time the degree to which it resides within that state.

    <IgbBulletGraph Height="80px" Width="100%"
      MinimumValue="0" Value="80" Interval="10"
      MaximumValue="100" TargetValue="90"
      RangeBrushes="#C62828,#F96232,#FF9800"
      RangeOutlines="#C62828,#F96232,#FF9800">
    <IgbLinearGraphRange
      StartValue="0"
      EndValue="40"
      InnerStartExtent="0.075"
      InnerEndExtent="0.075"
      OuterStartExtent="0.95"
      OuterEndExtent="0.95">
    </IgbLinearGraphRange>
    <IgbLinearGraphRange
      StartValue="40"
      EndValue="70"
      InnerStartExtent="0.075"
      InnerEndExtent="0.075"
      OuterStartExtent="0.95"
      OuterEndExtent="0.95">
    </IgbLinearGraphRange>
    <IgbLinearGraphRange StartValue="70"
      EndValue="100"
      InnerStartExtent="0.075"
      InnerEndExtent="0.075"
      OuterStartExtent="0.95"
      OuterEndExtent="0.95">
    </IgbLinearGraphRange>
    </IgbBulletGraph>
    

    Tick Marks

    The tick marks serve as a visual division of the scale into intervals in order to increase the readability of the bullet graph.

    • Major tick marks – The major tick marks are used as primary delimiters on the scale. The frequency they appear at, their extents and style can be controlled by setting their corresponding properties.
    • Minor tick marks – The minor tick marks represent helper tick marks, which might be used to additionally improve the readability of the scale and can be customized in a way similar to the major ones.
    <IgbBulletGraph Height="80px" Width="100%"
        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">
    </IgbBulletGraph>
    

    Labels

    The labels indicate the measures on the scale.

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

    Backing

    The backing element represents background and border of the bullet graph component. It is always the first element rendered and all the rest of elements such as labels, and tick marks are overlaid on top of it.

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

    Scale

    The scale is visual element that highlights the full range of values in the gauge. You can customize appearance and shape of the scale. The scale can also be inverted (using IsScaleInverted property) and all labels will be rendered from right-to-left instead of left-to-right.

    <IgbBulletGraph Height="80px" Width="100%"
      MinimumValue="0" Value="70" Interval="10"
      MaximumValue="100" TargetValue="90"
      IsScaleInverted="false"
      ScaleBackgroundBrush="DodgerBlue"
      ScaleBackgroundOutline="Red"
      ScaleBackgroundThickness="2"
      ScaleStartExtent="0.05"
      ScaleEndExtent="0.95">
    </IgbBulletGraph>
    

    Summary

    For your convenience, all above code snippets are combined into one code block below that you can easily copy to your project and see the bullet graph with all features and visuals enabled.

    <IgbBulletGraph Height="80px" Width="100%"
        MinimumValue="0" Value="50" Interval="10"
        MaximumValue="100" TargetValue="90"
        IsScaleInverted="false"
        ScaleBackgroundBrush="DodgerBlue"
        ScaleBackgroundOutline="Red"
        ScaleBackgroundThickness="2"
        ScaleStartExtent="0.05"
        ScaleEndExtent="0.95"
    
        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="DodgerBlue"
        Font="11px Verdana"
    
        BackingBrush="#BDDCFC"
        BackingOutline="DodgerBlue"
        BackingStrokeThickness="4"
        BackingInnerExtent="0"
        BackingOuterExtent="1"
        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"
    
        RangeBrushes="#C62828,#F96232,#FF9800"
        RangeOutlines="#C62828,#F96232,#FF9800">
        <IgbLinearGraphRange StartValue="20" EndValue="40"
            InnerStartExtent="0.025" InnerEndExtent="0.025"
            OuterStartExtent="0.9" OuterEndExtent="0.9">
        </IgbLinearGraphRange>
        <IgbLinearGraphRange StartValue="40" EndValue="60"
            InnerStartExtent="0.025" InnerEndExtent="0.025"
            OuterStartExtent="0.9" OuterEndExtent="0.9">
        </IgbLinearGraphRange>
        <IgbLinearGraphRange StartValue="60" EndValue="90"
            InnerStartExtent="0.025" InnerEndExtent="0.025"
            OuterStartExtent="0.9 OuterEndExtent="0.9">
        </IgbLinearGraphRange>
    </IgbBulletGraph>
    

    Additional Resources

    You can find more information about other types of gauges in these topics:

    API Members

    The following is a list of API members mentioned in the above sections: