Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Deneb: Vega-Lite - Línea vertical, regla entre 2 líneas

Hola
Tengo el siguiente visual en Vega-Lite.

DW868990_0-1692192298860.png

Mi resultado deseado es:

DW868990_1-1692192378641.png

Pero estoy luchando para agregar la marca de regla para las líneas verticales entre los 2 puntos: he intentado numerosas formas y no puedo hacer que se muestre como arriba. Supongo que está definiendo las propiedades y e y2, pero estaba luchando para hacer esto debido a las transformaciones existentes en mi código, que está a continuación. Cualquier ayuda apreciada.

{
"width": {"step": 45},
"data": {"name": "dataset"},
"codificación": {
"y": {
"field": "Opciones",
"title": null,
"sort": {"field": "DiscIndex"},
"cuadrícula": verdadero
},
"x": {
"field": "Índice",
"title": null,
"axis": {"orient": "top"}
}
},
"resolver": {
"y": {"scale": "independent"}
},
"capa": [
{
"marca": {
"tipo": "rect",
"trazo": "#FAF9F6",
"strokeWidth": 1
},
"codificación": {
"color": {
"field": "Opciones",
"escala": {
"dominio": [
">= 220",
"201-219",
"181-200",
"161-180",
"141-160",
"121-140",
"111-120",
"101-110",
"91-100",
"81-90",
"71-80",
"61-70",
"51-60",
"<= 50"
],
"rango": [
"#F69781",
"#FFFFFF",
"#FFFFFF",
"#FFFFFF",
"#FFFFFF",
"#FFFFFF",
"#FFFFFF",
"#FFF2AC",
"#FCC98A",
"#F69781",
"#F69781",
"#F69781",
"#F69781",
"#F69781"
]
},
"leyenda": null
}
}
},
{
"marca": {
"tipo": "texto",
"información sobre herramientas": false,
"trazo": "transparente",
"fontSize": 12
},
"codificación": {
"texto": {
"field": "Marcador de posición",
"tipo": "cuantitativo"
},
"color": {
"field": "Opciones",
"escala": {
"dominio": [
">= 220",
"201-219",
"181-200",
"161-180",
"141-160",
"121-140",
"111-120",
"101-110",
"91-100",
"81-90",
"71-80",
"61-70",
"51-60",
"<= 50"
],
"rango": [
"#F69781",
"#FFFFFF",
"#FFFFFF",
"#FFFFFF",
"#FFFFFF",
"#FFFFFF",
"#FFFFFF",
"#FFF2AC",
"#FCC98A",
"#F69781",
"#F69781",
"#F69781",
"#F69781",
"#F69781"
]
}
}
}
},
{
"marca": {
"tipo": "línea",
"punto": verdadero
},
"codificación": {
"x": {
"field": "Índice",
"title": null,
"axis": {"orient": "top"}
},
"y": {
"field": "Opciones",
"title": null,
"sort": {"field": "DiscIndex"}
},
"color": {"value": "#0066CC"}
},
"transformar": [
{
"filter": "datum['Options'] === datum['BinnedSBPOptions']"
}
]
},
{
"marca": {
"tipo": "texto",
"fontSize": 14,
"yOffset": -15,
"línea base": "medio"
},
"codificación": {
"texto": {
"campo": "SBP",
"tipo": "cuantitativo"
},
"x": {
"field": "Índice",
"title": null,
"axis": {"orient": "top"}
},
"y": {
"field": "Opciones",
"title": null
},
"color": {"value": "black"},
"opacidad": {
"condición": {
"test": "datum['Options'] === datum['BinnedSBPOptions']",
"valor": 1
},
"valor": 0
}
}
},
{
"marca": {
"tipo": "línea",
"punto": verdadero
},
"codificación": {
"x": {
"field": "Índice",
"title": null,
"axis": {"orient": "top"}
},
"y": {
"field": "Opciones",
"title": null,
"sort": {"field": "DiscIndex"}
},
"color": {"value": "red"}
},
"transformar": [
{
"filter": "datum['Options'] === datum['BinnedDBPOptions']"
}
]
}
]
}

0 REPLIES 0

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors