Signal,
увы мне))) не понимаю ... но на всякий случай ...
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
let arr = Array.from({length : 24}, (_, i)=> [i,Math.random() * 2 + 4]);
const average = arr.reduce((a,b) => a + b[1], 0)/24;
arr = arr.map( a => [...a, average]);
function drawChart() {
var data = google.visualization.arrayToDataTable( [
["data", "test", "average"], ...arr
]);
var options = {
title: 'на всякий случай',
legend: { position: 'bottom' },
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="curve_chart" style="width: 900px; height: 500px"></div>
</body>
</html>