CommonCharts中的tooltip.position属性,使用函数进行修改无法生效

小程序开发相关产品技术讨论,包括面板、智能小程序、React Native、Ray跨端框架、Panel SDK、微信小程序、小程序开发工具(IDE)及其他开发技术相关等话题


Post Reply
silverlight
Posts: 179

  • Tuya MiniApp IDE 版本信息:关于中查看
    • App 应用版本信息: 设置-关于中进行查看~
      "@ray-js/panel-sdk": "1.13.1",
      "@ray-js/ray": "1.6.1",
    • 相关代码:

      Code: Select all

                  <CommonCharts
                    unit="℃" // 数据单位
                    customStyle={{display:'flex',height: '450rpx',width:'450rpx',padding:'16rpx' }}
                    option={{
                      backgroundColor: '#fff',
                      xAxis: {
                        type: 'category',
                        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
                      },
                      yAxis: {
                        type: 'value',
                      },
                      tooltip: {
                        show: true,
                        position: function (point, params, dom, rect, size) {
                          // 固定在顶部
                          return [point[0], '10%'];
                      }
                      },
                      series: [
                        {
                          name: '测试样例',
                          data: [150, 230, 224, 218, 135, 147, 260],
                          type: 'bar',
                        },
                      ],
                    }} 
                  />
    • 日志信息:无
    • 问题描述(复现步骤):点击图表中某列数据,提示框并未按照position中定义的,位于该列顶部
    • 预期结果:点击后,提示框显示在该列顶部
    • 实际结果:随着鼠标浮动
Last edited by silverlight on 2025年 Jun 6日 13:11, edited 1 time in total.

Tags:
tdeveloper
Site Admin
Posts: 38

Re: CommonCharts中的tooltip.position属性,使用函数进行修改无法生效

你好,你的反馈已收到,我们将尽快答复你。

:arrow: 你对灵魂的渴望,是你命运的先知
yunyin
Posts: 8

Re: CommonCharts中的tooltip.position属性,使用函数进行修改无法生效

使用 CommonCharts 是 echarts 所有的 function 功能都需要使用 string Functional 形式。参考文档。https://developer.tuya.com/material/lib ... 8%EF%BC%89

silverlight
Posts: 179

Re: CommonCharts中的tooltip.position属性,使用函数进行修改无法生效

yunyin 2025年 Jun 5日 18:41

使用 CommonCharts 是 echarts 所有的 function 功能都需要使用 string Functional 形式。参考文档。https://developer.tuya.com/material/lib ... 8%EF%BC%89

谢谢,已经解决

Post Reply