When displaying a value in a stacked column chart, if the value is negative, the negative value should be drawn from the 0 position of the y-axis or from below the other negative value if it exists. Similarly, the positive value after the negative should be drawn from the 0 position of the y-axis or from above the other positive value if it exists. But instead, in both cases, they are being drawn from the end of the previous value, resulting in overlapping.
- Manash Prajapati asked 6 months ago
- last edited 6 months ago
- You must login to post comments
Hi Manash,
Thank you for your inquiry.
The best way we found for your need is to create 2 StackedColumnCollection instances, one for positive numbers, the other for negative numbers, in order to avoid overlapping.
Here are some code snippets to help filter the values from one another:
yValues: yValues1.map((v) => (v > 0 ? v : 0)) // get positive values only
yValues: yValues1.map((v) => (v < 0 ? v : 0)) // get negative values only
For a better understanding , we suggest you take a look at this CodePen:
https://codepen.io/vasculandrei/pen/poBBVVd
Best regards,
Vascul Andrei
SciChart Developer
- Andrei Vascul answered 6 months ago
- last edited 6 months ago
- You must login to post comments
Please login first to submit.