Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[错误报告]:插件中使用 ApexChart 中的bar显示label会出现s.toFixed is not a function #175

Open
4 tasks done
ting1e opened this issue Sep 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ting1e
Copy link

ting1e commented Sep 3, 2024

确认

  • 我的版本是最新版本,我的版本号与 version 相同。
  • 我已经 issue 中搜索过,确认我的问题没有被提出过。
  • 我已经 Telegram频道 中搜索过,确认我的问题没有被提出过。
  • 我已经修改标题,将标题中的 描述 替换为我遇到的问题。

当前程序版本

v1.9.14-2

问题描述

在开发插件时,使用VApexChart bar显示label时前端报错,图表显示有问题
image

前端报错 Uncaught (in promise) TypeError: s.toFixed is not a function,

报错代码
return window.Apex && (window.Apex.dataLabels = {
formatter: function(a, {seriesIndex: n, w: i}) {
const s = i.config.series[n];
return s.toFixed(s % 1 === 0 ? 0 : 1)
}
报错时 s 为
Proxy(Object) {name: 'upload', data: Array(21)}

禁用label后恢复正常
'dataLabels': {
'enabled': False,
},

发生问题时系统日志和配置文件

插件get_page 返回图表格式 
'component': 'VApexChart',
  'props': {
      'height': 300,
      'options': {
          'chart': {
              'type': 'bar',
          },  
          'title': {
              'text': f'上传下载总和'
          },

          'labels':sites,   #['1','2','3','4']          
      },

      'series': [
          {
              'name':'upload', 
              'data': ups,  #[1,2,3,4]
          },
          {
              'name':'download', 
              'data': dls, #[1,2,3,4]
          }
      ],
  }
@ting1e ting1e added the bug Something isn't working label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant