# 画布背景

¥Canvas background

在某些用例中,你可能希望在整个画布上使用背景图片或颜色。对此没有内置支持,你可以通过编写自定义插件来实现这一点。

¥In some use cases you would want a background image or color over the whole canvas. There is no built-in support for this, the way you can achieve this is by writing a custom plugin.

在下面的两个示例插件中,你可以看到如何将颜色或图片绘制到画布上作为背景。这种为图表提供背景的方法只有在你想要导出具有该特定背景的图表时才有必要。对于正常使用,你可以使用 CSS (opens new window) 更轻松地设置背景。

¥In the two example plugins underneath here you can see how you can draw a color or image to the canvas as background. This way of giving the chart a background is only necessary if you want to export the chart with that specific background. For normal use you can set the background more easily with CSS (opens new window).