-
-
Couldn't load subscription status.
- Fork 1.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Steps to Reproduce
Generate a chart with a data point that is 1e-7 or smaller
<Chart
options={{
chart: { id: "basic-bar" },
xaxis: { categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998] },
}}
series={[{ name: "series-1", data: [30, 40, 45, 50, 49, 60, 70, 1e-7] }]}
type="bar"
width="500"
/>
Expected Behavior
Chart should render
Actual Behavior
Chart crashes
Screenshots
Reproduction Link
https://codesandbox.io/p/sandbox/musing-water-56gs7n?file=%2Fsrc%2F_app.js%3A23%2C7
My Research
- this is the the line that crashes: because val is
apexcharts.js/src/modules/Range.js
Line 174 in 841e5f0
val.toString().split('.')[1].length 0 - reason for this is because Utils.noExponents is rounding
1e-7down to 0:apexcharts.js/src/utils/Utils.js
Line 154 in 841e5f0
return Math.round(num) // Round the number - Looking at the commit history, it seems 97ed0dc is the cause. Downgrading to 4.2.0 fixes it
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working