fix charts y coordinates
Gitea Actions Demo / build_and_push (push) Has been cancelled
Details
Gitea Actions Demo / build_and_push (push) Has been cancelled
Details
This commit is contained in:
parent
7c12da31af
commit
74467d1c7b
|
|
@ -51,16 +51,16 @@ export const GetWorkout = (url: string) => {
|
||||||
mapCenter = [coords[0][0], coords[0][1]];
|
mapCenter = [coords[0][0], coords[0][1]];
|
||||||
let datasets = [];
|
let datasets = [];
|
||||||
if (speed.length > 0) {
|
if (speed.length > 0) {
|
||||||
datasets.push({ radius: 0, label: 'Скорость', borderColor: '#00aa00', backgroundColor: '#00aa00', data: speed });
|
datasets.push({yAxisID: 'linear-y-axis', radius: 0, label: 'Скорость', borderColor: '#00aa00', backgroundColor: '#00aa00', data: speed });
|
||||||
}
|
}
|
||||||
if (heart_rate.length > 0) {
|
if (heart_rate.length > 0) {
|
||||||
datasets.push({ radius: 0, label: 'Пульс', borderColor: '#990000', backgroundColor: '#990000', data: heart_rate, });
|
datasets.push({yAxisID: 'linear-y-axis', radius: 0, label: 'Пульс', borderColor: '#990000', backgroundColor: '#990000', data: heart_rate, });
|
||||||
}
|
}
|
||||||
if (power.length > 0) {
|
if (power.length > 0) {
|
||||||
datasets.push({ radius: 0, label: 'Мощность', borderColor: '#cccccc', backgroundColor: '#cccccc', data: power, });
|
datasets.push({yAxisID: 'log-y-axis', radius: 0, label: 'Мощность', borderColor: '#cccccc', backgroundColor: '#cccccc', data: power, });
|
||||||
}
|
}
|
||||||
if (elevation.length > 0) {
|
if (elevation.length > 0) {
|
||||||
datasets.push( { radius: 0, label: 'Подъем', borderColor: '#000', backgroundColor: '#000', data: elevation, });
|
datasets.push( {yAxisID: 'linear-y-ground', radius: 0, label: 'Подъем', borderColor: '#000', backgroundColor: '#000', data: elevation, });
|
||||||
}
|
}
|
||||||
data = {
|
data = {
|
||||||
labels: times,
|
labels: times,
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,20 @@ const chartPlugins = [
|
||||||
const chartOptions = {
|
const chartOptions = {
|
||||||
responsive: true,
|
responsive: true,
|
||||||
scales: {
|
scales: {
|
||||||
|
y: {
|
||||||
|
type: 'linear',
|
||||||
|
display: false,
|
||||||
|
position: 'left',
|
||||||
|
id: 'linear-y-axis',
|
||||||
|
},
|
||||||
|
yGroung: {
|
||||||
|
type: 'linear',
|
||||||
|
display: false,
|
||||||
|
position: 'left',
|
||||||
|
id: 'linear-y-ground',
|
||||||
|
},
|
||||||
yAxes: {
|
yAxes: {
|
||||||
|
display: false,
|
||||||
type: 'logarithmic',
|
type: 'logarithmic',
|
||||||
position: 'right',
|
position: 'right',
|
||||||
stacked: false,
|
stacked: false,
|
||||||
|
|
@ -244,7 +257,8 @@ const chartOptions = {
|
||||||
},
|
},
|
||||||
gridLines: {
|
gridLines: {
|
||||||
display: true
|
display: true
|
||||||
}
|
},
|
||||||
|
id: 'log-y-axis',
|
||||||
},
|
},
|
||||||
x: {
|
x: {
|
||||||
type: 'time',
|
type: 'time',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue