1、使用中的坑

坑一:报错提示:

jwxwork-1.0.0.js:1 Uncaught TypeError: Cannot read property 'importKey' of undefined
at jwxwork-1.0.0.js:1
at we (jwxwork-1.0.0.js:1)

需要开启https,因为本地没有开启http所以会报这个错误

坑二:不报错不返回数据

注意大小写:departmentName

企业微信通讯录替换-Echarts中使用部门名称

 

 使用小写不行

2、一个最简单的示例 

function getFetchData()
{
   let items= [
        {
            type: 'departmentName', // departmentName
            id: '1', // openid
        },
        {
            type: 'departmentName', // departmentName
            id: '2', // openid
        }
    ]

    if (WWOpenData.initCanvas) {
        WWOpenData.initCanvas()
    }
    console.log("start prefetch");
    WWOpenData.prefetch({ items }, (err, data) => {
        if (err) {
        }
        console.log("data:");
        console.log(data);
        //resolve(data)
    })
}

返回结果示例
企业微信通讯录替换-Echarts中使用部门名称

 将返回的带有类似 烫烫烫 的data数据 传给chart控件即可。

3、chart控件的提示框和legend渲染方式不一样,处理后,legend显示正常,提示框反而不正常了,需要再将提示框单独按普通标签替换单独处理,请自行参考

option.tooltip

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2021-09-11
  • 2021-11-18
  • 2022-01-20
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-04-20
  • 2021-11-28
相关资源
相似解决方案