I wanted to make you aware of an issue that I have encountered in your Charts.
I am creating a simple line chart with data.
My data has a min value of -8735800
My data has a max value of 9.59129166666667e+36
The logic in the initDefaults function creates a majorUnit from the large max number, and then
in the floor method applies that to the min value, leaving the min value as
2e+36 and the max value of either 1.1999999999999998e+37 or 1.0000000000000001e+37
(depending on whether the roundToMajorUnit option is specified). So far, this makes sense.
However, this causes an issue because later, when we get to the formatNumber function (if using the default format of #.##########, or any format with a similar structure, I imagine), it tries to call:
round(number, Math.abs(fraction[1]))
where number=2e+36 and fraction[1]=+36 (Math.abs(fraction[1])=36
which then errors out in the round function because the precision is 36 which is > 20 (javascript toFixed function is the culprit here).
This should not have been an issue since my values are all valid values and I even made sure that I
didn't have any decimal places longer than 20 places. Your logic should account for very large whole numbers.
I resolved this for my situation by specifying that the format for the labels was = null, but this should be
addressed in your code since using the default format #.########## with large numbers will break the series on the chart.
I am creating a simple line chart with data.
My data has a min value of -8735800
My data has a max value of 9.59129166666667e+36
The logic in the initDefaults function creates a majorUnit from the large max number, and then
in the floor method applies that to the min value, leaving the min value as
2e+36 and the max value of either 1.1999999999999998e+37 or 1.0000000000000001e+37
(depending on whether the roundToMajorUnit option is specified). So far, this makes sense.
However, this causes an issue because later, when we get to the formatNumber function (if using the default format of #.##########, or any format with a similar structure, I imagine), it tries to call:
round(number, Math.abs(fraction[1]))
where number=2e+36 and fraction[1]=+36 (Math.abs(fraction[1])=36
which then errors out in the round function because the precision is 36 which is > 20 (javascript toFixed function is the culprit here).
This should not have been an issue since my values are all valid values and I even made sure that I
didn't have any decimal places longer than 20 places. Your logic should account for very large whole numbers.
I resolved this for my situation by specifying that the format for the labels was = null, but this should be
addressed in your code since using the default format #.########## with large numbers will break the series on the chart.