Kieran Quinn
Kieran Quinn

Reputation: 1115

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:

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

Upvotes: 1

Views: 1901

Answers (1)

Anshul Nema
Anshul Nema

Reputation: 56

By default it creates a stacked chart. You can set isStack to false.

Upvotes: 4

Related Questions