How to hide the three-dot dropdown menu on a Vega chart?
Asked Answered
F

2

9

I have a simple chart embedded in my website. Using the vega-lite spec v5. Here's an example:

chart with vega menu

The circle with three dots triggers a drop-down menu with some actions, including opening the chart in an online vega editor. I don't want to expose these actions to the end user.

How can I disable the menu?

Fauve answered 3/9, 2020 at 1:45 Comment(0)
C
11

This is called the "actions" menu, and it can be controlled via the actions option in the vegaEmbed call used to display the chart.

You can hide the menu by setting actions: false; it would look something like this:

<div id="vis"></div>
<script type="text/javascript">
  var spec = "https://raw.githubusercontent.com/vega/vega-lite/master/examples/specs/bar.vl.json";
  vegaEmbed('#vis', spec, {"actions": false});
</script>

More information on available options can be found at https://github.com/vega/vega-embed#options

Clarance answered 3/9, 2020 at 17:10 Comment(1)
Thanks, worked like a charm. Knowing the right terms to search for is key!Fauve
C
0

If you use React you can add actions={false} to remove it

<VegaLite spec={spec} actions={false} />
Carencarena answered 25/4, 2022 at 8:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.