xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

Tooltips are not contained within window #307

Closed TaylorShane closed 3 years ago

TaylorShane commented 3 years ago

On small screens tooltips partially appear outside the browser window. They should instead be bound to the confines of the browser window so all content can be read.

Version: "@angular/animations": "-11.2.1", "@angular/common": "~11.2.1", "@angular/compiler":"-11.2.1", "@angular/core": "~11.2.1", "@angular/forms": "-11.2.1", "@angular/localize": "~11.2.1", "@angular/platform-browser": "-11.2.1 "@angular/platform-browser-dynamic": "-11.2.1", "@angular/router":"-11.2.1", "bootstrap": "^4.6.0", "echarts": "^5.0.2", "ngx-bootstrap": "^6.2.0", "ngx-echarts": "^6.0.0",

Screenshot_20210424-184605.png

chuck0523 commented 3 years ago

Did you try confine option ?

If not, try setting below

tooltip: {
  confine: true
}

ref: https://echarts.apache.org/en/option.html#tooltip.confine

TaylorShane commented 3 years ago

Thanks @chuck0523! I got lost in the mass of documentation and didn't see this optional argument.