uniapp uCharts图表在微信小程序中点击位置不对且有一部分点击不到。

图表在APP和H5中的点击位置是正常的,在微信小程序中会出现点击位置不对且有部分地方点击不到,最终我的解决方法如下。

1.查看包裹图表的元素中有没有元素开启了定位,可以去除定位属性试一试。

2.为微信平台的图表添加 isScrollView="true"属性。

                                            <view class="" style="height: 5.1rem;margin-top: 0.25rem; ">
                            
                                                <!-- #ifdef MP-WEIXIN -->
                                                    <qiun-data-charts
                                                      type="column"
                                                      :opts="opts3"
                                                      inScrollView="true"
                                                      :chartData="chartData3"
                                                      tooltipFormat="tTemplate"
                                                      @getIndex="showMyTooltip"
                                                    />
                                                <!-- #endif -->
                                                <!-- #ifndef MP-WEIXIN -->
                                                    <qiun-data-charts
                                                      type="column"
                                                      :opts="opts3"
                                                      :chartData="chartData3"
                                                      tooltipFormat="tTemplate"
                                                      @getIndex="showMyTooltip"
                                                    />
                                                <!-- #endif -->
                                            </view>

 

posted @ 2022-06-14 11:36  zy-lzh  阅读(2349)  评论(0)    收藏  举报