1. Learn
  2. /
  3. Courses
  4. /
  5. Interactive Data Visualization with Bokeh

Connected

Exercise

Changing line plots with Select

For your final task, the hedge fund has asked you to put together visualizations enabling analysis of Electronic Arts' stock performance.

You decide the Select widget would be ideal, so they can switch between the following metrics: close, market_cap, and volume.

The stocks dataset has been filtered for EA. Three figures (close, market_cap, and volume) and sets of glyphs (close_line, market_cap_line, volume) have been created for each metric and preloaded for you.

Instructions

100 XP
  • Create menu by calling Select(), passing a list to the options argument containing "Close", "Market Cap", and "Volume" (in that order), setting value to "Close", and giving title of "Metric".
  • Call an appropriate menu method to link the "value" of the widget to callback.
  • Call layout inside show, displaying the widget above the figures close, market_cap, and volume.