微信小程序使用antv f2 设置toolitp不起作用

支付宝转微信开发 ,都是用antv 发现设置好tooplitp不起作用,刚开始以为是触摸事件没有监听到,去源码打印发现没有问题,
重新整理使用发现是没有把chart return出来

  onInitChart4(F2, config) {
          chart4 = new F2.Chart(config);
          const data = [
            { codeType: "测试", reportDate: "2011-10-01", value: null },
          ];
          chart4.source(data, {
            reportDate: {
              tickCount: 8,
              range: [0, 1],
              formatter: val => {
                console.log(val)
                  return val.split("-")[2];
              }
            },
            value: {
              tickCount: 8,
                tickLine: 1,
                isRounding: true,
                max: 12,
                min: 0
            }
          });
          chart4.line().position('reportDate*value').color('codeType'); // 重新定义图形语法
          chart4.point().position('reportDate*value').style({
            stroke: '#fff',
            lineWidth: 1
          });
          chart4.tooltip({ //提示信息自定义
            showCrosshairs: true,
            showItemMarker: false,
            onShow: function onShow(ev) {
                console.log(ev)
                var items = ev.items.splice(1, 1);
                console.log(items)
                items[0].name = items[0].name;
                items[0].value = items[0].value;
            }
        });
          chart4.render();
          // 注意:需要把chart return 出来
          return chart4;
        },

目前想知道怎么能够吧onInitChart4放data外边使用,那位大佬看见求指点

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大白菜1号

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值