You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Ovilia <ov...@gmail.com> on 2020/01/21 01:51:51 UTC

Re: 兼容性问题,h5页面(vue), 在ios10.1.1 7P、ios 13.3 iphone 8P、6ie11下,饼图的toolTip高度不是自动适应的, 文字上方有一大段空白 版本: 4.1.0-rc.2

Hi,

If you think this is a bug, please open an issue at
https://github.com/apache/incubator-echarts/issues
And please use English in your future emails in the mailing list.

Thanks

Wenli


On Fri, Jan 17, 2020 at 9:39 PM f(x)=y <fa...@qq.com> wrote:

> cdn引入vue的项目中
> https://cdn.bootcss.com/echarts/4.1.0.rc2/echarts-en.common.min.js
>
> 饼图的初始化代码,这是一个js文件,放在一个公共库里
> pie(dataName, dataArr) {
>     let arr = [];
>     for (let item of dataArr) {
>       arr.push(item.name + item.value)
>     }
>     return {
>       tooltip: {
>         trigger: 'item',
> formatter: "{a} <br/>{b} : {c} ({d}%)",
>       },
>       color: ['#0293FE', '#FFB001', '#FF583D', '#FF7C41', '#6ABFFF',
> '#4AA8FF'],
>       legend: {
>         orient: 'vertical',
>         left: 'center',
>         top: 0,
>         data: dataName,
>         formatter: function (res) {
>           for (let item of dataArr) {
>             if (item.name == res) {
>               return res + '   ' + item.value + '%' + ' ' + '(' + item.num
> + '题)';
>             }
>           };
>         }
>       },
>       series: [{
>         name: '错题率',
>         type: 'pie',
>         radius: '55%',
>         center: ['50%', '40%'],
>         data: dataArr,
>         itemStyle: {
>           normal: {
>             label: {
>               show: false
>             },
>             labelLine: {
>               show: false
>             }
>           },
>         },
>       }]
>     }
>   },
>
> 在vue组件中引入js文件,import eChart from '../../lib/myCharts.js',
>
> 初始化饼图
> let myChart = echarts.init(document.getElementById('map1'));
> myChart.setOption(eChart.pie(dataName,dataArr))
>
> 通过审查元素,排除了样式的影响。设置extraCssText:'width:160px;height:60px;'或者通过js动态设置toolTip高度,
> 文字因为溢出被隐藏掉了,试了最新版本还是出现同样的问题。这个配置在android, chrome和firefox下可以得到预期效果。
>
> ie下
> ios下
>
> chrome下
>
>
>