DearMrJ commented on issue #14714:
URL: https://github.com/apache/echarts/issues/14714#issuecomment-822935278
@plainheart Hi,I have tried this way before by using attr graphic(see
below), but it also **left some space** which is similar to the demo. it seems
that we got a fake grid width/height. Why space remain after filling and how
can I solve it?
```js
const graphic = {
type: 'image',
id: 'bgImg',
$action: 'replace',
bounding: 'all',
style: {
// image:
'https://ss2.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/5d6034a85edf8db18e821f720a23dd54564e7473.jpg',
image: this.image,
x: this.defInfoChart._api.getCoordinateSystems()[0]._rect.x,
y: this.defInfoChart._api.getCoordinateSystems()[0]._rect.y,
width: this.defInfoChart.convertToPixel({ gridId: 'grid1' },
[this.chartData.pnl_w, 0])[0] -
this.defInfoChart._api.getCoordinateSystems()[0]._rect.x, // max(x) - offsetX
height: this.defInfoChart.convertToPixel({ gridId: 'grid1' },
[this.chartData.pnl_w, 0])[1] -
this.defInfoChart._api.getCoordinateSystems()[0]._rect.y // max(y) - offsetY
}
}
this.defInfoChart.setOption({ graphic: graphic })
```
> @DearMrJ Hi, I just thought out a workaround. Here is the demo:
https://codepen.io/plainheart/pen/bGgmGPj. Hope that helps.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]