The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hola
Tengo el siguiente visual en Vega-Lite.
Mi resultado deseado es:
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']"
}
]
}
]
}
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.