Incubator-echarts: 如何把图表中文字大小使用rem控制

Created on 5 Dec 2018  ·  3Comments  ·  Source: apache/incubator-echarts

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

support

Most helpful comment

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 :)

All 3 comments

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

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 :)

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',
}
Was this page helpful?
0 / 5 - 0 ratings