0

The following example should work, but it requires the selenium package (as I understand, under the hood chartify builds an interactive chart using the bokeh package and takes a screenshot with selenium)

import chartify

chartify.examples.plot_scatter()

The code above doesn't work because I can't configure a driver for Selenium, which is normally done similar to this:

from selenium import webdriver
 driver = webdriver.Chrome(executable_path=(my_path + '/chromedriver)')

How can I pass this driver object to chartify?

Alex F
  • 756
  • 2
  • 9
  • 24
  • 1
    https://github.com/spotify/chartify Scroll down to "Installation". You don't need to pass in the driver... it'll launch it, but will rely on chromedriver and chrome being in path. (though honestly I would avoid the screenshot part if you can. You should be able to output an HTML file?) – pcalkins Jan 30 '20 at 20:01

1 Answers1

2

It looks like they have hardcoded the creation and configuration of the webdriver in a Chart method _initialize_webdriver.

If you want something different than what they do, I think monkey-patching the Chart. _initialize_webdriver method to override it is the only current option. It might be worth opening a issue on their GH tracker to discuss adding the ability to customize webdriver creation.

bigreddot
  • 33,642
  • 5
  • 69
  • 122