Open lukwallace opened 5 years ago
I took a look at the data and noticed the extremely large number of decimal places being used.
Seems that when I fix the y
value to a single decimal point using parseFloat((value).toFixed(1)
, then the chart padding fixes itself.
Its possible that there is some floating point issue happening in the niceMinMax
function that is causing Contour to just give up and not calculate the correct padding for the chart.
Reference in code, using Y-Axis as example:
The spacing calculated for the left padding:
^ Uses
tmpScale.ticks(options.ticks)
to generate approximated tick values for spacing calculationThe actual tick value calculation for the y-axis:
^ Uses
options.tickValues || _.nw.niceTicks(dMin, dMax, options.ticks);
to generate the actual tick values to be rendered.This will occasionally cause the the ticks labels to be rendered with an inaccurate amount of space for them. We managed to produce this issue with a standard column chart using the data:
[{"x":"AGM","y":12.125990845966125},{"x":"Supercapacitor","y":-12.39133198369404}]