Skip to content

文档上暂时没找到如何设置shape 为text-block字体的颜色和大小 #1994

Answered by NewByVector
Momo23015258 asked this question in Q&A
Discussion options

You must be logged in to vote

使用 label 是文本容器的选择器。

graph.addNode({
  x: 160,
  y: 120,
  width: 360,
  height: 120,
  shape: 'text-block',
  text: `There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.`,
  attrs: {
    label: {
      style: {
        color: 'red'
      }
    }
  },
})

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by NewByVector
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants