简体   繁体   中英

Disable tooltip labels being truncated/increasing tooltip character limit when using vega-lite

Im creating a visualization in kibana using vega-lite, but I suppose this applies anywhere. Is there a way in vega-lite to disable, or at least increase the character length of the tooltip so that it is not truncated? I can't find any documentation or links about this. Thanks. The following is a rough example. I'd like the tooltip to show the full length of 'aaaaabbbcccc' instead of it being automatically truncated to 'aaabbbc...'

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {
    "values": [
      {"a": "AAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCC", "b": 28},
      {"a": "B", "b": 55},
      {"a": "C", "b": 43},
      {"a": "D", "b": 91},
      {"a": "E", "b": 81},
      {"a": "F", "b": 53},
      {"a": "G", "b": 19},
      {"a": "H", "b": 87},
      {"a": "I", "b": 52}
    ]
  },
  "mark": "bar",
  "encoding": {
    "x": {"field": "a", "type": "ordinal"},
    "y": {"field": "b", "type": "quantitative"},
    "tooltip": [
      {"field": "a", "type": "ordinal"},
      {"field": "b", "type": "quantitative"}
    ]
  },
   "config": {
    "view": {"stroke": "transparent"},
    "axis": {
      "labelColor": "#98A2B3",
      "grid": false,
      "labelLimit": 100
    }
  }
}

Online editor

I tried manipulating the graph that you've provided and it worked for me:

I just changed the label limit to an arbitrary big number like 500

"config": {
    "view": {"stroke": "transparent"},
    "axis": {
      "labelColor": "#98A2B3",
      "grid": false,
      "labelLimit": 500
    }
}

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM