You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Deneb柱状图添加数据标签后排序失效问题咨询

Deneb柱状图添加数据标签后排序失效问题咨询

嗨各位大佬,想请教个Deneb的问题:我之前用Deneb做了个柱状图,是按照DAX度量值Measure1来排序的,显示一切正常。但当我添加了一个数据标签的mark之后,图表的排序就乱掉了,不再按Measure1排序,反而变成按Site Name排序了,这可愁死我了😅

我希望能让这个柱状图恢复按Measure1排序的状态,下面是我的Deneb配置代码,麻烦大家帮我看看哪里出问题了:

{
  "title": {"text": "Simple Bar chart - labels", "fontSize": 14, "anchor": "start", "align": "left"},
  "data": {"name": "dataset"},
  "encoding": {
    "y": {
      "field": "Site Name",
      "type": "nominal",
      "sort":  {"field": "Measure1", "order": "ascending"}
    },
    "x": {
      "field": "Measure1",
      "type": "quantitative"
    }
  },
  "layer": [
    {
      "mark": {
        "type": "bar",
        "color": "pink"
      }
    },
    {
      "mark": {
        "type": "text",
        "color": "black",
        "align": "left",
        "dx": 6
      },
      "encoding": {
        "text": {"field": "Measure1", "type": "quantitative"}
      }
    }
  ]
}

备注:内容来源于stack exchange,提问作者Davide Di Franco

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 11:53:11