echarts添加文字水印,在option里添加graphic即可,详细代码如下所示:
option={{
toolbox: {
feature: {
dataZoom: {
yAxisIndex: 'none',
},
restore: {},
saveAsImage: {},
},
},
xAxis: {
type: 'time',
},
yAxis: {
type: 'value',
},
graphic: [
{
type: 'group',
// rotation: Math.PI / 2,
bounding: 'raw',
right:200,
top: 40,
z: 100,
children: [
{
type: 'text',
left: 'center',
top: 'center',
z: 100,
style: {
fill: '#cccccc',
text: `想添加的文字水印`,
font: 'bold 16px sans-serif'
}
}
]
},],
}}