var avgTemperature = [ 0.94, 0.95, 5.29, 7.97, 12.70, 16.26, 19.19, 20.63, 14.98, 8.13, 5.51, 4.27 ];
var monthNames = [ "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień" ];

for (var i = 0; i < avgTemperature.length; i = i + 1) {
  var div = document.createElement("div");
  div.innerText = monthNames[i] + ": " + avgTemperature[i];
  document.body.appendChild(div);

  var bg = document.createElement("div");
  bg.style.width = avgTemperature[i] * 20 + "px";
  bg.style.height = "2px";
  bg.style.background = "#bbb";
  document.body.appendChild(bg);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.