antvis/G2

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

senlinmilelu posted onGitHub

问题描述

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


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

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

posted by hustcc about 1 year ago
.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>
   </>
)

请问在哪写回调

posted by senlinmilelu about 1 year ago

Fund this Issue

$0.00
Funded

Pull requests