Descripción general de Web Components Bullet Graph

    El componente de gráfico de viñetas Web Components permite una vista lineal y concisa de las medidas comparadas con una escala.

    El componente de gráfico de viñetas Ignite UI for Web Components le brinda la capacidad de crear presentaciones de datos atractivas, reemplazando los medidores y medidores que se utilizan en los tableros con gráficos de barras simples pero directos y claros. Un gráfico de viñetas es una de las formas más efectivas y eficientes de presentar el progreso hacia los objetivos, rangos buenos/mejores/mejores, o comparar múltiples mediciones en el menor espacio horizontal o vertical posible.

    Web Components Bullet Graph Example

    The following sample demonstrates how setting multiple properties on the same IgcBulletGraphComponent 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.

    Dependencies

    Al instalar el paquete de medidores, también se debe instalar el paquete central.

    npm install --save igniteui-webcomponents-core
    npm install --save igniteui-webcomponents-gauges
    

    Component Modules

    The IgcBulletGraphComponent requires the following modules:

    import { IgcBulletGraphCoreModule  } from 'igniteui-webcomponents-gauges';
    import { IgcBulletGraphModule } from 'igniteui-webcomponents-gauges';
    import { ModuleManager } from 'igniteui-webcomponents-core';
    
    // register the modules
    ModuleManager.register(
        IgcBulletGraphCoreModule,
        IgcBulletGraphModule
    );
    

    Usage

    El siguiente código explica cómo crear un componente de gráfico de viñetas y configurar una barra de rendimiento, un marcador de medida comparativa y tres rangos comparativos en la escala.

      <igc-bullet-graph height="100px"
        width="300px"
        minimum-value="5"
        maximum-value="55"
        value="35"
        target-value="43">
        <igc-linear-graph-range
          start-value="0"
          end-value="15"
          brush="#828181">
        </igc-linear-graph-range>
        <igc-linear-graph-range
          start-value="15"
          end-value="30"
          brush="#AAAAAA">
        </igc-linear-graph-range>
        <igc-linear-graph-range
          start-value="30"
          end-value="55"
          brush="#D0D0D0">
        </igc-linear-graph-range>
      </igc-bullet-graph>
    

    Comparative Measures

    El gráfico de viñetas puede mostrar dos medidas: valor de rendimiento y valor objetivo.

    El valor de rendimiento es la medida principal que muestra el componente y se visualiza como una barra que se extiende a lo largo de todo el gráfico. El valor objetivo es una medida con la que se compara el valor del rendimiento. Se muestra como un pequeño bloque que corre perpendicular a la orientación de la barra de rendimiento.

      <igc-bullet-graph
        height="80px"
        width="400px"
        value="50"
        value-brush="DodgerBlue"
        value-stroke-thickness="1"
        value-inner-extent="0.5"
        value-outer-extent="0.65"
        target-value="80"
        target-value-breadth="10"
        target-value-brush="LimeGreen"
        target-value-outline="LimeGreen"
        target-value-stroke-thickness="1"
        target-value-inner-extent="0.3"
        target-value-outer-extent="0.85"
        minimum-value="0"
        maximum-value="100">
      </igc-bullet-graph>
    

    Highlight Value

    The bullet graph's performance value can be further modified to show progress represented as a highlighted value. This will make the value appear with a lower opacity. A good example is if value is 50 and highlightValue is set to 25. This would represent a performance of 50% regardless of what the value of targetValue is set to. To enable this first set highlightValueDisplayMode to Overlay and then apply a highlightValue to something lower than value.

    <igc-bullet-graph
        id="gauge"
        height="80px"
        width="100%"
        minimum-value="0"
        maximum-value="100"
        value="70"
        interval="10"
        target-value="90"
        label-interval="10"
        label-extent="0.025"
        labels-pre-terminal="0"
        labels-post-initial="0"
        highlight-value-display-mode="Overlay"
        highlight-value="25" >
    </igc-bullet-graph>
    

    Comparative Ranges

    Los rangos son elementos visuales que resaltan un rango específico de valores en una escala. Su propósito es comunicar visualmente el estado cualitativo de la barra de medición de desempeño, ilustrando al mismo tiempo el grado en que se encuentra dentro de ese estado.

      <igc-bullet-graph
        height="80px" width="400px"
        minimum-value="0" value="80" interval="10"
        maximum-value="100" target-value="90"
        range-brushes ="#C62828, #F96232, #FF9800"
        range-outlines="#C62828, #F96232, #FF9800">
        <igc-linear-graph-range
          start-value="0" end-value="40"
          inner-start-extent="0.075" inner-end-extent="0.075"
          outer-start-extent="0.95" outer-end-extent="0.95">
        </igc-linear-graph-range>
        <igc-linear-graph-range
          start-value="40" end-value="70"
          inner-start-extent="0.075" inner-end-extent="0.075"
          outer-start-extent="0.95" outer-end-extent="0.95">
        </igc-linear-graph-range>
        <igc-linear-graph-range
          start-value="70" end-value="100"
          inner-start-extent="0.075" inner-end-extent="0.075"
          outer-start-extent="0.95" outer-end-extent="0.95">
        </igc-linear-graph-range>
      </igc-bullet-graph>
    

    Tick Marks

    Las marcas sirven como una división visual de la escala en intervalos para aumentar la legibilidad del gráfico de viñetas.

    • Marcas de graduación principales: las marcas de graduación principales se utilizan como delimitadores principales en la escala. La frecuencia con la que aparecen, su extensión y estilo se pueden controlar estableciendo sus propiedades correspondientes.
    • Marcas de graduación menores: las marcas de graduación menores representan marcas de graduación auxiliares, que pueden usarse para mejorar aún más la legibilidad de la escala y se pueden personalizar de manera similar a las principales.
      <igc-bullet-graph
        height="80px" width="400px"
        minimum-value="0" value="70"
        maximum-value="100" target-value="90"
        interval="10"
        tick-brush="DodgerBlue"
        ticks-pre-terminal="0"
        ticks-post-initial="0"
        tick-stroke-thickness="2"
        tick-start-extent="0.2"
        tick-end-extent="0.075"
        minor-tick-count="4"
        minor-tick-brush="DarkViolet"
        minor-tick-end-extent="0.1"
        minor-tick-start-extent="0.2"
        minor-tick-stroke-thickness="1">
      </igc-bullet-graph>
    

    Labels

    Las etiquetas indican las medidas de la báscula.

      <igc-bullet-graph
        height="80px" width="400px"
        minimum-value="0" value="70" interval="10"
        maximum-value="100" target-value="90"
        label-interval="10"
        label-extent="0.025"
        labels-pre-terminal="0"
        labels-post-initial="0"
        font-brush="DodgerBlue"
        font="11px Verdana">
      </igc-bullet-graph>
    

    Backing

    El elemento de respaldo representa el fondo y el borde del componente del gráfico de viñetas. Siempre es el primer elemento representado y el resto de elementos, como etiquetas y marcas, se superponen encima.

      <igc-bullet-graph
        height="80px" width="400px"
        minimum-value="0" value="70" interval="10"
        maximum-value="100" target-value="90"
        backing-brush="#bddcfc"
        backing-outline="DodgerBlue"
        backing-stroke-thickness="4"
        backing-inner-extent="0"
        backing-outer-extent="1">
      </igc-bullet-graph>
    

    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.

      <igc-bullet-graph
        height="80px" width="400px"
        minimum-value="0" value="70" interval="10"
        maximum-value="100" target-value="90"
        is-scale-inverted="false"
        scale-background-brush="DodgerBlue"
        scale-background-outline="DarkViolet"
        scale-background-thickness="2"
        scale-start-extent="0.05"
        scale-end-extent="0.95">
      </igc-bullet-graph>
    

    Summary

    Para su comodidad, todos los fragmentos de código anteriores se combinan en un bloque de código a continuación que puede copiar fácilmente a su proyecto y ver el gráfico de viñetas con todas las funciones y elementos visuales habilitados.

      <igc-bullet-graph
        height="80px" width="400px"
        minimum-value="0"
        maximum-value="100"
        is-scale-inverted="false"
        scale-background-brush="Gray"
        scale-background-outline="Gray"
        scale-background-thickness="2"
        scale-start-extent="0.05"
        scale-end-extent="0.95"
    
        value="50"
        value-brush="Black"
        value-stroke-thickness="1"
        value-inner-extent="0.5"
        value-outer-extent="0.65"
        target-value="80"
        target-value-breadth="7.5"
        target-value-brush="Black"
        target-value-outline="Black"
        target-value-stroke-thickness="1"
        target-value-inner-extent="0.3"
        target-value-outer-extent="0.85"
    
        label-interval="10"
        label-extent="0.025"
        labels-pre-terminal="0"
        labels-post-initial="0"
        font-brush="Black"
        font="11px Verdana"
    
        backing-brush="#cecece"
        backing-outline="#cecece"
        backing-stroke-thickness="4"
        backing-inner-extent="0"
        backing-outer-extent="1"
    
        interval="10"
        tick-brush="Black"
        ticks-pre-terminal="0"
        ticks-post-initial="0"
        tick-stroke-thickness="2"
        tick-start-extent="0.2"
        tick-end-extent="0.075"
    
        minor-tick-count="4"
        minor-tick-brush="Black"
        minor-tick-end-extent="0.1"
        minor-tick-start-extent="0.2"
        minor-tick-stroke-thickness="1"
    
        range-brushes="#C62828, #F96232, #FF9800"
        range-outlines="#C62828, #F96232, #FF9800">
        <igc-linear-graph-range
          start-value="20" end-value="40"
          inner-start-extent="0.25" inner-end-extent="0.25"
          outer-start-extent="0.9" outer-end-extent="0.9">
        </igc-linear-graph-range>
        <igc-linear-graph-range
          start-value="40" end-value="60"
          inner-start-extent="0.25" inner-end-extent="0.25"
          outer-start-extent="0.9" outer-end-extent="0.9">
        </igc-linear-graph-range>
        <igc-linear-graph-range
          start-value="60" end-value="90"
          inner-start-extent="0.25" inner-end-extent="0.25"
          outer-start-extent="0.9" outer-end-extent="0.9">
        </igc-linear-graph-range>
      </igc-bullet-graph>
    

    API References

    La siguiente es una lista de miembros de API mencionados en las secciones anteriores:

    Additional Resources

    Puede encontrar más información sobre otros tipos de medidores en estos temas: