diff --git a/weather/src/components/chart.js b/weather/src/components/chart.js index 8c2dcc99..96e555de 100644 --- a/weather/src/components/chart.js +++ b/weather/src/components/chart.js @@ -1,4 +1,3 @@ -import _ from "lodash"; import React from "react"; import { Sparklines, @@ -7,7 +6,8 @@ import { } from "react-sparklines"; function average(data) { - return _.round(_.sum(data) / data.length); + let sum = data.reduce((previous, current) => current += previous); + return Math.round(sum / data.length); } export default props => {