VTK Chart Overlay Doesn't work with VTK 9

Hey everyone, I’m trying to overlay a chart on a 3d scene. This works in VTK versions < 9. Additionally I found the chart overlay example online doesn’t work with VTK 9.

Example: https://lorensen.github.io/VTKExamples/site/Cxx/Plotting/ChartsOn3DScene/

Is this a bug? Is there any workaround? Here’s the call stack:

vtkRenderingContext2D-9.0.dll!vtkContextActor::RenderOverlay(vtkViewport * viewport) Line 230	C++
vtkRenderingOpenGL2-9.0.dll!vtkOpenGLRenderer::UpdateGeometry(vtkFrameBufferObjectBase * fbo) Line 406	C++
vtkRenderingOpenGL2-9.0.dll!vtkOpenGLRenderer::DeviceRender() Line 263	C++
vtkRenderingCore-9.0.dll!vtkRenderer::Render() Line 378	C++
vtkRenderingCore-9.0.dll!vtkRendererCollection::Render() Line 53	C++
vtkRenderingCore-9.0.dll!vtkRenderWindow::DoStereoRender() Line 340	C++
vtkRenderingCore-9.0.dll!vtkRenderWindow::Render() Line 299	C++
vtkRenderingOpenGL2-9.0.dll!vtkOpenGLRenderWindow::Render() Line 2042	C++
ChartsOn3DScene.exe!main(int __formal, char * * __formal) Line 119	C++

In particular on ln230 of vtkContextActor.cxx it tries to access a NULL device from the context resulting in an access violation reading location thrown.

This appears to already be fixed on master and only present on the VTK 9 release.