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

[Bug] 3d散点图label设置fontWeight: 'bold' fontSize: 16 中文在首行就会出现字体的头部缺失 #20818

Open
xsonglive opened this issue Mar 12, 2025 · 3 comments
Labels
bug pending We are not sure about whether this is a bug/new feature.

Comments

@xsonglive
Copy link

Version

5.2.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=scatter3D-dataset&gl=1&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAzACIBcya6l6AthNGQLQCMADADQVU0CGGZrnWAF8OVAJ458xMqi6Va9WM3aCq1XvxaCRggF6TCpcnJp1GrUSfV9YAqjqp4ApgCcITvCQDaq4yf9gYiBOZADkeADG3GBgrsShlv5yADbcAEZOyTK-SVx4ABbAAO5kYC4Ark6JuSYgwHgQkDBhbgDm-WAJOTXosRhgAMqBySF-PbkAJvhg3NARoyrjNRHAycAuJKFpyZVdS7lp6xOuAOoQE2D5_NX7XGncEQDWrS7A5dATAMKr62Fls3gQNwXE5oJ0brdKAAzGBgE5OCDtMBhQ7JCZ7SFyGFggYQXSjJgAFghSwcmNgMJc6hirjCSDSQlC3X8ZKWeDE1FRuPxZGJzJME2i3DIXlk5Og3GoowABoADeUAvprYsAMBo8olsJXwxEdEioibSknjABu3B2oy8DAArGwLCwALr8uRCB09Vm5MVLQLBMKRaKxFzxQ3-VIZLJjSEFYqlCpVR1JOoNJqKUJtDoYzF9QbDUYe8noKZ4GZzUbWuM9FZrDYppzooP7Q4uY4uM4XK62OtLe5PF5vD7fSt_FwAoEgsHpvMU2FapEo1a1ss1JXcgkANg7STdt0p1P9dIZTNum5q7M5q2XvPXVEFMxFuduEqlZDlithKrxISYK_QmoRM9gWznBJAFo5QBw00AELdABZNQAuf0ARk1ADC5QAAOUAC4TADAlAAdaBACDNQAc80AI2NABkIwBMJUAWDlYINBc5BNM0RXYK02HtCjhBdGojzkO8ai9UZwiiGkAyIccehDTJsjzSMSlgMpKkvWp6kaKBk1TcFGKoTMhjEEYRInfNplmeYyFLLT0ArX4tlSJ4BPJBsmxbS5rmUkwu2eV53i-H4Nn_f5oEBYFQSUwzJzBacdQAtELMxJd3zIAAmRZyVY8Ztz9Wl_3pRlGPi_wTy5SLYD5W5r2FWBRXs9AHxlBUlTfHkYoCuFfx1f89QSci8yoyoaLYa0GMPZjcgyyg7WqF5zmkcNHEKcTJNjfxDgwAAJerkVsdhYAAelWwAwdUAeucwMADazADK9bojXcIpvjBV4w3YqhujdIQUDu6gxE-fJgTAAA6ZwwAAeXAeSAApQCTABKABuIA

Steps to Reproduce

option = {
xAxis3D: {
min: -10,
max: 10
},
yAxis3D: {
min: -10,
max: 10
},
zAxis3D: {
min: -10,
max: 10
},
series:[
{
type: 'scatter3D',
label: {
show: true,
position: 'right',
textStyle: {
distance: 0,
color:'blue',
borderWidth: 1,
backgroundColor: 'transparent',
fontWeight: 'bold',
fontSize: 14,
},
formatter: '{b}'
},
symbolSize: 4,
data: [{
name: 你好font-size:14,fontWeight:bold,
value: [-5,10,0]
}]
},
{
type: 'scatter3D',
label: {
show: true,
position: 'right',
textStyle: {
distance: 5,
color:'red',
borderWidth: 1,
backgroundColor: 'transparent',
fontWeight: 'bold',
fontSize: 16,
},
formatter: '{b}'
},
symbolSize: 4,
data: [{
name: 你好font-size:16 fontWeight: 'bold',中文的头缺失了一部分\n如果换行则不缺失,
value: [0,-5,0]
}]
},
{
type: 'scatter3D',
label: {
show: true,
position: 'right',
textStyle: {
distance: 5,
color:'black',
borderWidth: 1,
backgroundColor: 'transparent',
fontWeight:'bold',
fontSize: 20,
},
formatter: '{b}'
},
symbolSize: 4,
data: [{
name: 你好font-size:20 fontWeight: 'bold',,
value: [0,5,0]
}]
},
],
grid3D: {
show: true,
boxHeight: 10, //圆环的高度
viewControl: {

    },
}

}
myChart.setOption(option);

Image

Current Behavior

3d散点图的label:的textStyle中的fontSize为16,fontWeight为bold时,label首行显示的中文的头会缺失一部分

Expected Behavior

希望正常显示或者能解释原因

Environment

- OS:Windows 10 Version 22H2 (Build 19045.5131)
- Browser:117.0.5938.89 (正式版本) (64 位)

Any additional comments?

No response

@xsonglive xsonglive added the bug label Mar 12, 2025
@echarts-bot echarts-bot bot added the pending We are not sure about whether this is a bug/new feature. label Mar 12, 2025
Copy link

echarts-bot bot commented Mar 12, 2025

@xsonglive It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] 3d scatter plot label setting fontWeight: 'bold' fontSize: 16 Chinese will have missing font heads on the first line

@Justin-ZS
Copy link

Cannot reproduce bug on Mac, but I have encountered similar issues before, and that was a simple legend.
It is likely that echarts did not consider font-family when measuring font size.

@xsonglive
Copy link
Author

Cannot reproduce bug on Mac, but I have encountered similar issues before, and that was a simple legend. It is likely that echarts did not consider font-family when measuring font size.

This problem only occurs when fontFamily is empty and has a specific size, but it does not have this problem after specifying the fontFamliy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

2 participants