Closed d3nd3 closed 1 year ago
var data = [1,3,8,10,12,10,8,3,1]; g.clear(); require("graph").drawBar(g, data, { miny: 0, axes : true, gridx : 1, gridy : 5 });
https://github.com/espruino/EspruinoDocs/blob/36d65564f17dd11b521b9ba48e42992dd8dd6499/modules/graph.js#L101
i is a string because key of array. "1" + 0.5 == "10.5" "11" + 0.5 == "110.5"
i
"1" + 0.5 == "10.5"
"11" + 0.5 == "110.5"
Thanks! just fixed.
It's because recently Espruino changed to make array indices strings (to match the JS spec)
https://github.com/espruino/EspruinoDocs/blob/36d65564f17dd11b521b9ba48e42992dd8dd6499/modules/graph.js#L101
i
is a string because key of array."1" + 0.5 == "10.5"
"11" + 0.5 == "110.5"