Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Antd Charts – Area chart series values plot relative to last series

I’m trying to use Ant Design charts to plot an area chart with 3 series – actual, target and forecast. For some reason, the chart plots the series relative to the last item in the array, rather than relative to the x axis. I tried setting the startOnZero: true but that didn’t help.

See below example:
enter image description here

In this example, the target is 220 and the actual is 1558, but the target point is higher on the y axis. Recreated:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

https://codesandbox.io/s/beautiful-grothendieck-qtjj7?file=/App.tsx:8366-8384

If we put the ‘Target’ values to the bottom of the data array, it works fine for some reason:

enter image description here

>Solution :

By default it creates stacked chart, you can set isStack to false

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading