I remember answering a very similar question of you a few days back. It also had sparse y-values problem to break the graph. I copy here the very same solution which apparently works just fine. The (new Array(months.length)).fill(0).map((e,i) => i === months.indexOf(c.months) line is in charge to form an initial array filled with zeros and with a value for the months index position. (i.e. Jan value at index 0 Dec value at index 11)