Skip to content

Possibility of multiple x / y axes #261

Answered by rokotyan
mirshko asked this question in Q&A
Discussion options

You must be logged in to vote

@mirshko Currently we've no plans for adding dual-axis support since they can easily be misused.

However, if you really need to have a dual axis chart, you can achieve that by overlaying two XY Containers with manual margin configuration (autoMargin set to false, margin set to accommodate your axes). Here's a React example:

   ...
  const margin = { left: 60, right: 60, top: 40, bottom: 40 }
  const style = { position: 'absolute', top: 0, left: 0, width: '100%', height: '40vh' }
  return (<>
    <VisXYContainer data={data} margin={margin} autoMargin={false} style={style}>
      <VisArea x={d => d.x} y={d => d.y} />
      <VisAxis type='x' />
      <VisAxis type='y' />
    </VisXYContainer>

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@mirshko
Comment options

@rokotyan
Comment options

@mirshko
Comment options

@rokotyan
Comment options

Answer selected by mirshko
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
2 participants
Converted from issue

This discussion was converted from issue #256 on August 14, 2023 22:59.