[Feat]: 节点的标签怎么旋转90度 #7563
Unanswered
xiaozhuzhr
asked this question in
Q&A
Replies: 1 comment
-
|
@xiaozhuzhr 您好!以下是关于您问题的自动回复: 您好,感谢您的建议! 关于“节点的标签怎么旋转90度”,您可以通过设置节点标签的 实现方式G6 支持通过 const graph = new Graph({
container: 'container',
width: 600,
height: 400,
data: {
nodes: [
{ id: 'node1', style: { x: 100, y: 100, labelText: '旋转标签', labelTransform: [['rotate', 90]] } },
{ id: 'node2', style: { x: 300, y: 100, labelText: '标签2', labelTransform: [['rotate', 90]] } },
],
edges: [],
},
node: {
style: {
labelFontSize: 14,
labelFill: '#333',
},
},
});
graph.render();说明
进阶:批量设置所有节点标签旋转如果需要对所有节点统一设置,可以在节点样式配置中添加: node: {
style: {
labelTransform: [['rotate', 90]],
// 其他标签样式
}
}参考文档如果您愿意贡献代码,欢迎提交 PR 或分享您的实现思路,我们会及时跟进与协助! 如有更多定制化需求或遇到问题,欢迎继续反馈。😊 此回复由 AI 助手自动生成。如有任何问题,我们的团队会尽快跟进。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature / 功能描述
我希望节点的标签可以旋转90度显示
Are you willing to contribute? / 是否愿意参与贡献?
✅ Yes / 是
Beta Was this translation helpful? Give feedback.
All reactions