We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
例如formatter属性为函数时,本地看为正常,发布后存在卡死现象,并且影响了图表显示 formatter(value: any) { // 浮窗内容及数字处理 const data = value[0]; return ${new Date().getFullYear()}.${data.name} ${data.marker} ${ data.seriesName }: ${formatterVariable.date(data.value)}; }
formatter(value: any) { // 浮窗内容及数字处理 const data = value[0]; return
; }
The text was updated successfully, but these errors were encountered:
参考 #6 提供一下设备信息和可供运行的最小复现代码。
另外,可以尝试更新到 1.9.0 版本,看看是否还有这个问题。
1.9.0
Sorry, something went wrong.
更新版本为1.9.0版本。原因找到。是因为formatter为函数时,对数字的处理函数写在组件内。代码如下: // 处理Y轴数字显示规则 const handleY = (value: any) => { // alert((value); if (value >= 1e8) { return parseInt(${value / 1e8}) + '亿'; } if (value >= 1e4) { return parseInt(${value / 1e4}) + '万'; } return value; }; ..... yAxis: { type: 'value', offset: 5, axisLabel: { formatter(value: any) { return formatterVariable.data(value) // 此处是传入 formatterVariable属性的对象函数 {data: handleY}; }, }, }, 用上面这种写法图表就会无法显示,并且出一条虚线。只能把对数字的处理放到函数当中才行。如下: formatter(value: any) { // 浮窗内容及数字处理 const data = value[0]; let num = data.value; if (num >= 1e8) { num = parseFloat(${num / 1e8}).toFixed(1) + '亿'; } if (num >= 1e4) { num = parseFloat(${num / 1e4}).toFixed(1) + '万'; } return ${new Date().getFullYear()}.${data.name} ${data.marker} ${data.seriesName}: ${num}; }
// 处理Y轴数字显示规则 const handleY = (value: any) => { // alert((value); if (value >= 1e8) { return parseInt(
) + '亿'; } if (value >= 1e4) { return parseInt(
) + '万'; } return value; }; ..... yAxis: { type: 'value', offset: 5, axisLabel: { formatter(value: any) { return formatterVariable.data(value) // 此处是传入 formatterVariable属性的对象函数 {data: handleY}; }, }, },
formatter(value: any) { // 浮窗内容及数字处理 const data = value[0]; let num = data.value; if (num >= 1e8) { num = parseFloat(
).toFixed(1) + '亿'; } if (num >= 1e4) { num = parseFloat(
).toFixed(1) + '万'; } return
No branches or pull requests
例如formatter属性为函数时,本地看为正常,发布后存在卡死现象,并且影响了图表显示
formatter(value: any) { // 浮窗内容及数字处理 const data = value[0]; return
${new Date().getFullYear()}.${data.name}${data.marker} ${
data.seriesName
}: ${formatterVariable.date(data.value)}
; }
The text was updated successfully, but these errors were encountered: