When using the XYChart in combination with a numeric range for the x-axis, the distance between the individual data points is not always correct. This leads to the data being distorted in an unpredictable way and data points on the right hand side of the diagram to be cut off.
Steps to reproduce
Copy the code sample below or create a XYChart with a numeric range where $\text{max} - \text{min} + 1 \ne \text{number of data points}$.
Screenshots
Code Sample
xychart-beta
x-axis 0 --> 2
line [0, 1, 0, 1]
bar [1, 0, 1, 0]
Setup
Mermaid version: 10.9.1
Suggested Solutions
Change const step = (max - min + 1) / data.length; in xychartDb.ts to const step = (max - min) / (data.length - 1);.
Description
When using the XYChart in combination with a numeric range for the x-axis, the distance between the individual data points is not always correct. This leads to the data being distorted in an unpredictable way and data points on the right hand side of the diagram to be cut off.
Steps to reproduce
Copy the code sample below or create a XYChart with a numeric range where $\text{max} - \text{min} + 1 \ne \text{number of data points}$.
Screenshots
Code Sample
Setup
Suggested Solutions
Change
const step = (max - min + 1) / data.length;
in xychartDb.ts toconst step = (max - min) / (data.length - 1);
.Additional Context
No response