问题
I see from https://vega.github.io/vega-lite/docs/config.html that it is possible to change the background color. But i don't see any docs for adding an underlay background image.
回答1:
vega-lite creates a canvas element.
So adding a background image is explained in a question about how to add a background to a canvas element.
HTML5 Canvas background image
But you can just do it with css:
canvas {
background: url("my_background.png");
}
This is just like any other background image css.
https://developer.mozilla.org/en-US/docs/Web/CSS/background-image
来源:https://stackoverflow.com/questions/49580080/is-it-possible-to-add-a-background-image-to-a-plot-in-vega-or-vega-lite