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 Ejemplo de gráfico de viñetas
El siguiente ejemplo demuestra cómo configurar varias propiedades en el mismo IgcBulletGraphComponent puede transformarlo en un gráfico de viñetas completamente diferente.
<!DOCTYPE html><html><head><title>BulletGraphAnimation</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"><buttonid="animationButton1"class="options-button">Gauge Animation #1</button><buttonid="animationButton2"class="options-button">Gauge Animation #2</button><buttonid="animationButton3"class="options-button">Gauge Animation #3</button></div><igc-bullet-graphid="gauge"height="80px"width="100%"minimum-value="0"maximum-value="120"value-brush="#4286f4"value="70"target-value-brush="#4286f4"target-value="90"target-value-breadth="10"interval="10"label-interval="10"label-extent="0.02"range-brushes ="#FF9800, #F96232, #C62828"range-outlines="#FF9800, #F96232, #C62828"scale-background-thickness="0"scale-background-brush="#dbdbdb"scale-background-outline="gray"></igc-bullet-graph></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
¿Te gusta esta muestra? Obtenga acceso a nuestro kit de herramientas de Ignite UI for Web Components completo y comience a crear sus propias aplicaciones en minutos. Descárgalo gratis.
El gráfico de viñetas admite una escala, un conjunto de marcas y un conjunto de etiquetas. El componente de gráfico de viñetas también tiene soporte integrado para transiciones animadas. Esta animación se puede personalizar fácilmente configurando la propiedad transitionDuration. Las características del gráfico de viñetas incluyen orientación y dirección configurables, elementos visuales configurables como la aguja y más.
dependencias
Al instalar el paquete de medidores, también se debe instalar el paquete central.
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.
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.
<!DOCTYPE html><html><head><title>BulletGraphMeasures</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-bullet-graphid="gauge"height="80px"width="100%"minimum-value="0"maximum-value="100"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"scale-background-brush = "#e5e5e5"scale-background-outline = "#e5e5e5"backing-brush = "#f7f7f7"backing-outline = "#bfbfbf"tick-stroke-thickness = "1.5" ></igc-bullet-graph></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
Valor destacado
El valor de rendimiento del gráfico de viñetas se puede modificar aún más para mostrar el progreso representado como un valor resaltado. Esto hará que aparezca value con una opacidad más baja. Un buen ejemplo es si value es 50 y highlightValue se establece en 25. Esto representaría un rendimiento del 50%, independientemente de cuál sea el valor de targetValue. Para habilitar esto, primero establezca highlightValueDisplayMode en Superposición y, a continuación, aplique a highlightValue a algo inferior a value.
<!DOCTYPE html><html><head><title>BulletGraphHighlightNeedle</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-bullet-graphid="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></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
Rangos comparativos
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.
<!DOCTYPE html><html><head><title>BulletGraphRanges</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-bullet-graphid="gauge"height="80px"width="100%"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-rangename="range1"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-rangename="range2"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-rangename="range3"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></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
Marcas de verificación
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.
<!DOCTYPE html><html><head><title>BulletGraphTickmarks</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-bullet-graphheight="80px"width="100%"minimum-value="0"value="70"interval="10"maximum-value="100"target-value="90"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></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>BulletGraphLabels</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-bullet-graphid="gauge"height="80px"width="100%"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></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
Apoyo
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.
<!DOCTYPE html><html><head><title>BulletGraphBackground</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-bullet-graphid="gauge"height="80px"width="100%"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></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
Escala
La escala es un elemento visual que resalta toda la gama de valores del indicador. Puede personalizar la apariencia y la forma de la escala. La escala también se puede invertir (usando la propiedad isScaleInverted) y todas las etiquetas se representarán de derecha a izquierda en lugar de de izquierda a derecha.
<!DOCTYPE html><html><head><title>BulletGraphScale</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-bullet-graphid="gauge"height="80px"width="100%"minimum-value="0"value="70"interval="10"maximum-value="100"target-value="90"is-scale-inverted="false"scale-background-brush="DodgerBlue"scale-background-outline="Red"scale-background-thickness="2"scale-start-extent="0.05"scale-end-extent="0.95" ></igc-bullet-graph></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
Resumen
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.