Replies: 6 comments
-
hey @nouman91 thanks for checking out so to get what you want, you should do something like the following (currently your <XYChart {...}>
<AreaSeries />
<LineSeries />
<GlyphSeries />
</XYChart> |
Beta Was this translation helpful? Give feedback.
-
@williaster Thank you for replying so quickly. Yeah, I had tried switching its place but it did not working. This is the result if I use the above arrangement. I also tried other position but its always stays there |
Beta Was this translation helpful? Give feedback.
-
This is how it looks if I remove the line series. I think there is something essential I am missing & can't quite figure it out the what. ![]() |
Beta Was this translation helpful? Give feedback.
-
to me it looks like your x-accessor is returning different data since the series are not aligned (hard to tell without a code snippet, but the x-accessor is different in your original code snippet). also to make the bottom of the area not map to zero you need to specify bot |
Beta Was this translation helpful? Give feedback.
-
I managed to put together a dirty code sandbox please check when you get a chance |
Beta Was this translation helpful? Give feedback.
-
Moving this issue to a discussion |
Beta Was this translation helpful? Give feedback.
-
Hi Visx folks,
I am working with XY scatter chart and my use case is to have area series & line series in the same chart. I want to have area series as a background to Line Series. I have attached two images one is final result and one is my current progress. I am not able to figure out how to get area behind the lines. For reference area is the blue color wavy part on the chart.
Final Chart:
Current chart:
![Screenshot 2024-04-02 at 4 26 59 PM](https://private-user-images.githubusercontent.com/17067898/318966136-d9df907a-a813-4595-89b8-622b36a4c92e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMDE3OTYsIm5iZiI6MTczOTAwMTQ5NiwicGF0aCI6Ii8xNzA2Nzg5OC8zMTg5NjYxMzYtZDlkZjkwN2EtYTgxMy00NTk1LTg5YjgtNjIyYjM2YTRjOTJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA3NTgxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRiYTJiNThlNjEyYWJmMDg1ZjcxMDgwMmZiYTljYWVjY2Y4MjM3NjJlZDA1ZmE0MmMwZGNmOWFkOGJmMTIyZTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.k3vGMmJ_QJ9T3OYSm9WD7IxhwSNgEXSi0SZBsa_5R2E)
Sample code that I am working with
` <XYChart
xScale={{ type: 'band', nice: true }}
yScale={{ type: 'linear', nice: true }}
width={props.width}
height={500}
>
Any idea or suggestion on how can I achieve the above result?
Thanks for your awesome work!
Beta Was this translation helpful? Give feedback.
All reactions