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

如何把图表中文字大小使用rem控制 #9525

Closed
WenkaiZhou opened this issue Dec 5, 2018 · 8 comments
Closed

如何把图表中文字大小使用rem控制 #9525

WenkaiZhou opened this issue Dec 5, 2018 · 8 comments
Labels

Comments

@WenkaiZhou
Copy link

项目要用在4K高清大屏上展示,图表可以自适应,但是文字特小。请问,有没有什么方法能统一把单位从px改成rem ?

@pissang
Copy link
Contributor

pissang commented Dec 5, 2018

Currently rem is not supported. You can set different font size according to the resolution of page when initializing echarts

@pjar
Copy link

pjar commented Jan 18, 2019

Would be a nice feature. It's possible to use percentages. We use that for label, the disadvantage is that the font family will be reset to default one as the generated this way text styles look like this:
style="font: 80% px sans-serif;"

One trick here would be add your desired font named as px :)

@little-sean
Copy link

how to use this trick, could you give code example, I tried like below,but it didnt work

label: {
         fontSize: '150%',
         fontFamily: 'px  :) Simsun',
 }
label: {
        fontSize: '150%',
        fontFamily: 'px  Simsun',
}

@zhoufanglu
Copy link

2021年了,这个功能有支持了吗?

@plainheart
Copy link
Member

@zhoufanglu Using rem unit in font size has been supported since v5.

@zhoufanglu
Copy link

@zhoufanglu Using rem unit in font size has been supported since v5.

4.9支持吗?我现在用的是4.9..

@plainheart
Copy link
Member

@zhoufanglu I'm afraid no. It's a new feature brought in ECharts 5. Refer to ecomfe/zrender#612 for more details.

@zhoufanglu
Copy link

@zhoufanglu I'm afraid no. It's a new feature brought in ECharts 5. Refer to ecomfe/zrender#612 for more details.

好的 谢谢大佬的回答

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants