Reputation: 11
I want to create a floating bar chart that mimics a boxplot, since Recharts doesn't have a boxplot option. Is there a way to create a floating box plot in Recharts?
Upvotes: 1
Views: 1600
Reputation: 691
Yes!
Setting the data to be an array of two values will work.
const data = [
{
name: "Page A",
uv: [1500, 4500]
},
{
name: "Page B",
uv: [1000, 3000]
},
];
https://codesandbox.io/s/simple-bar-chart-forked-ol9h5
Update:
To get it to be floating if the Bar
has a stackId
https://recharts.org/en-US/api/Bar#stackId, have one stack be at the bottom with color: transparent
Upvotes: 1