简体   繁体   中英

react-vega - how to add dropdown menu to react app to chart without vega-embed?

Here is an example of Vega chart with menu: https://bl.ocks.org/domoritz/raw/455e1c7872c4b38a58b90df0c3d7b1b9/

In this example chart is generated with vega-embed and has a dropdown menu. 在此处输入图片说明

I use react-vega for charts. Here is an example of my chart that uses react-vega: https://codesandbox.io/s/m7xp6ro5wx

Question 1: What is the best way to add menu to this chart (react-vega chart in react app)? Question 2: How to change the style of this menu?

If you don't want to use Vega-embed, you can always use Vanilla React and other components library to develop your own dropdown menu. (This is beyond the scope of the Vega / React-Vega library.)

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