Hi,
Wow, that is old code, 2.x vintage. Things have moved on somewhat, you code will have had an archive database name as archive_database in your skin config (recall 2.x and earlier had two databases; an archive database and a stats database. 3.x and later has a singe database). The accepted way know to specify a source of archive data is to provide a binding name (as defined in weewx.conf [DataBindings], wx_binding is the default and most likely what you want. If your image generator class has derived itself from imagegenerator.ImageGenerator then your generator will have everything it needs to know to access that binding, if not then you really need to change that or you will likely run into a number of other 2.x/3.x issues/differences. lastGoodStamp is unchanged as long as you have a db manager from your binding there is no change needed there.
getSqlVectorsExtended has disappeared, there is not just getSqlVectors though it should work just fine for you though with a slightly different signature and returning two time vectors.
I would try something like this (untested of course):
binding = plot_options.get('binding', 'wx_binding')
archivedb = self.db_binder.get_manager(binding)
plotgen_ts = archivedb.lastGoodStamp()
plot_tspan = weeutil.weeutil.TimeSpan(minstamp, maxstamp)
(time_vec_t_ws, time_stop_vec_t_ws, data_windSpeed) = archivedb.getSqlVectors(plot_tspan, 'windSpeed', aggregate_interval=aggregate_interval)
Note the above relies on you now using a config option 'binding' in your skin config file to specify the binding to be used (or you an leave it out to default to wx_binding):
binding = some_binding_name
You will find much of what you need code wise in bin/weewx/manager.py and bin/weewx/imagegenerator.py.
Gary