add elevation
Gitea Actions Demo / build_and_push (push) Successful in 1m24s Details

This commit is contained in:
artem 2024-11-28 20:45:17 +03:00
parent 18c8174d2d
commit 40a2510b71
1 changed files with 7 additions and 4 deletions

View File

@ -171,9 +171,9 @@ const chartOptions = {
yAxes: { yAxes: {
type: 'logarithmic', type: 'logarithmic',
position: 'right', position: 'right',
stacked: true, stacked: false,
ticks: { ticks: {
beginAtZero: true beginAtZero: false
}, },
gridLines: { gridLines: {
display: true display: true
@ -206,6 +206,7 @@ const chartOptions = {
return ["Скорость: " + Math.floor(data.value.datasets[0].data[context.dataIndex]), return ["Скорость: " + Math.floor(data.value.datasets[0].data[context.dataIndex]),
"Пульс: " + data.value.datasets[1].data[context.dataIndex], "Пульс: " + data.value.datasets[1].data[context.dataIndex],
"Мощность: " + data.value.datasets[2].data[context.dataIndex], "Мощность: " + data.value.datasets[2].data[context.dataIndex],
"Подъем: " + data.value.datasets[3].data[context.dataIndex],
]; ];
} }
} }
@ -242,9 +243,10 @@ const initWorkout = (id: string) => {
let heart_rate = []; let heart_rate = [];
let power = []; let power = [];
let coords = []; let coords = [];
let elevation = [];
for (let i in response.data.results) { for (let i in response.data.results) {
response.data.results[i].lang; console.log(response.data.results[i].elevation, response.data.results[i].power);
response.data.results[i].lang; elevation.push(response.data.results[i].elevation);
times.push(response.data.results[i].time); times.push(response.data.results[i].time);
speed.push(msToKmh(response.data.results[i].speed)); speed.push(msToKmh(response.data.results[i].speed));
power.push(response.data.results[i].power); power.push(response.data.results[i].power);
@ -259,6 +261,7 @@ const initWorkout = (id: string) => {
{ radius: 0, label: 'Скорость', borderColor: '#00aa00', backgroundColor: '#00aa00', data: speed }, { radius: 0, label: 'Скорость', borderColor: '#00aa00', backgroundColor: '#00aa00', data: speed },
{ radius: 0, label: 'Пульс', borderColor: '#990000', backgroundColor: '#990000', data: heart_rate, }, { radius: 0, label: 'Пульс', borderColor: '#990000', backgroundColor: '#990000', data: heart_rate, },
{ radius: 0, label: 'Мощность', borderColor: '#cccccc', backgroundColor: '#cccccc', data: power, }, { radius: 0, label: 'Мощность', borderColor: '#cccccc', backgroundColor: '#cccccc', data: power, },
{ radius: 0, label: 'Подъем', borderColor: '#000', backgroundColor: '#000', data: elevation, },
] ]
} }