Power BI Deneb瀑布图使用x2规则时X轴排序异常问题
Vega-Lite瀑布图迁移至Power BI Deneb后的X轴排序异常问题
- 在Vega Editor中用Vega-Lite制作的瀑布图,仅最后一条规则超出图表区域,其余显示正常。
- 将代码迁移至Power BI Deneb时,仅替换数据集为动态(数据内容与原数据完全一致),却出现X轴前两个值排序混乱的问题。
- 经排查,问题与
x2编码直接相关:注释掉x2编码后,排序恢复正常,目前无法确定问题源于代码本身还是Power BI Deneb的设置。
相关代码片段:
"mark": { "type": "rule", "color": "#000000dc", "opacity": 1, "strokeWidth": 3, "xOffset": {"expr": "-(clamp((width / datum.count) / 2, 10, 25))"}, "x2Offset": {"expr": "clamp((width / datum.count) / 2, 10, 25)"} }, "encoding": { "x": { "field": "risco", "type": "nominal", "sort": {"field": "sortkey", "order": "ascending"}, "axis": {"title": null} }, "x2": { "field": "lead", "type": "nominal", "sort": {"field": "sortkey", "order": "ascending"} }, "y": {"field": "cumulative", "type": "quantitative"} }
Vega Editor效果:
Power BI Deneb效果:
内容的提问来源于stack exchange,提问作者Talles Lessa
相关产品推荐
相关产品推荐

