Skip to content

如何设置FacetRect各个plot的间距,类似V4的spacing? #5932

Closed Answered by Xiatian-leo
Xiatian-leo asked this question in Q&A
Discussion options

You must be logged in to vote

已解决了,通过在scale中添加 paddingInner:0

const facetRect = chart
  .facetRect({
    paddingOuter: 0,
  })
  .data({
    type: 'fetch',
    value: 'https://assets.antv.antgroup.com/g2/anscombe.json',
  })
  .encode('x', 'series')
  // .axis(false)
  // .legend(false)
  .style({
    fill: 'rgba(0,0,0,0.1)',
    stroke: 'red',
    strokeWidth: 1,
  })
  // 此处添加
  .scale({
    x: {
      paddingInner: 0
    }
  })

Replies: 1 comment

Comment options

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