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

怎么设置label文本字体大小 #6100

Closed
senlinmilelu opened this issue Feb 28, 2024 · 2 comments
Closed

怎么设置label文本字体大小 #6100

senlinmilelu opened this issue Feb 28, 2024 · 2 comments

Comments

@senlinmilelu
Copy link

问题描述

treemap每一项数据 label文字大小怎么设置
label={{
style: {
fontSize:20,//通过数据设置
}
}}

重现链接

No response

重现步骤

No response

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@hustcc
Copy link
Member

hustcc commented Feb 28, 2024

.style('labelFontSize', 10)
.style('labelFontSize', (d) => 10)

可以写一个具体的字体数字,也可以使用回调。

@hustcc hustcc closed this as completed Feb 29, 2024
@senlinmilelu
Copy link
Author

.style('labelFontSize', 10)
.style('labelFontSize', (d) => 10)

可以写一个具体的字体数字,也可以使用回调。

dv.source(datas, {
type: 'hierarchy',
}).transform({
field: 'value',
type: 'hierarchy.treemap',
tile: 'treemapResquarify',
as: ['x', 'y'],
});

return (
    <>
        <TreemapChart
            height={800}
            data={dv.rows.data}
            description={{visible: false}}
            colorField='name'
            label={{
                style: {
                    textBaseline: 'middle',
                    // fontSize:20,
                },
            }}
       </TreemapChart>
   </>
)

请问在哪写回调

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

No branches or pull requests

2 participants