mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-03 17:12:31 +00:00
progress
This commit is contained in:
@@ -231,16 +231,16 @@
|
||||
|
||||
$: if (chart && $settings) {
|
||||
let gpxFiles = new GPXFiles(get(fileOrder).filter((f) => $selectedFiles.has(f)));
|
||||
let data = gpxFiles.getTrackPointsAndStatistics();
|
||||
|
||||
// update data
|
||||
let trackPointsAndStatistics = gpxFiles.getTrackPointsAndStatistics();
|
||||
chart.data.datasets[0] = {
|
||||
label: $_('quantities.elevation'),
|
||||
data: trackPointsAndStatistics.points.map((point, index) => {
|
||||
data: data.points.map((point, index) => {
|
||||
return {
|
||||
x: getConvertedDistance(trackPointsAndStatistics.statistics.distance[index]),
|
||||
x: getConvertedDistance(data.point_statistics.distance[index]),
|
||||
y: point.ele ? getConvertedElevation(point.ele) : 0,
|
||||
slope: trackPointsAndStatistics.statistics.slope[index],
|
||||
slope: data.point_statistics.slope[index],
|
||||
surface: point.getSurface(),
|
||||
coordinates: point.getCoordinates()
|
||||
};
|
||||
@@ -251,10 +251,10 @@
|
||||
};
|
||||
chart.data.datasets[1] = {
|
||||
label: datasets.speed.getLabel(),
|
||||
data: trackPointsAndStatistics.points.map((point, index) => {
|
||||
data: data.points.map((point, index) => {
|
||||
return {
|
||||
x: getConvertedDistance(trackPointsAndStatistics.statistics.distance[index]),
|
||||
y: getConvertedVelocity(trackPointsAndStatistics.statistics.speed[index])
|
||||
x: getConvertedDistance(data.point_statistics.distance[index]),
|
||||
y: getConvertedVelocity(data.point_statistics.speed[index])
|
||||
};
|
||||
}),
|
||||
normalized: true,
|
||||
@@ -263,9 +263,9 @@
|
||||
};
|
||||
chart.data.datasets[2] = {
|
||||
label: datasets.hr.getLabel(),
|
||||
data: trackPointsAndStatistics.points.map((point, index) => {
|
||||
data: data.points.map((point, index) => {
|
||||
return {
|
||||
x: getConvertedDistance(trackPointsAndStatistics.statistics.distance[index]),
|
||||
x: getConvertedDistance(data.point_statistics.distance[index]),
|
||||
y: point.getHeartRate()
|
||||
};
|
||||
}),
|
||||
@@ -275,9 +275,9 @@
|
||||
};
|
||||
chart.data.datasets[3] = {
|
||||
label: datasets.cad.getLabel(),
|
||||
data: trackPointsAndStatistics.points.map((point, index) => {
|
||||
data: data.points.map((point, index) => {
|
||||
return {
|
||||
x: getConvertedDistance(trackPointsAndStatistics.statistics.distance[index]),
|
||||
x: getConvertedDistance(data.point_statistics.distance[index]),
|
||||
y: point.getCadence()
|
||||
};
|
||||
}),
|
||||
@@ -287,9 +287,9 @@
|
||||
};
|
||||
chart.data.datasets[4] = {
|
||||
label: datasets.atemp.getLabel(),
|
||||
data: trackPointsAndStatistics.points.map((point, index) => {
|
||||
data: data.points.map((point, index) => {
|
||||
return {
|
||||
x: getConvertedDistance(trackPointsAndStatistics.statistics.distance[index]),
|
||||
x: getConvertedDistance(data.point_statistics.distance[index]),
|
||||
y: getConvertedTemperature(point.getTemperature())
|
||||
};
|
||||
}),
|
||||
@@ -299,9 +299,9 @@
|
||||
};
|
||||
chart.data.datasets[5] = {
|
||||
label: datasets.power.getLabel(),
|
||||
data: trackPointsAndStatistics.points.map((point, index) => {
|
||||
data: data.points.map((point, index) => {
|
||||
return {
|
||||
x: getConvertedDistance(trackPointsAndStatistics.statistics.distance[index]),
|
||||
x: getConvertedDistance(data.point_statistics.distance[index]),
|
||||
y: point.getPower()
|
||||
};
|
||||
}),
|
||||
@@ -310,7 +310,7 @@
|
||||
hidden: true
|
||||
};
|
||||
chart.options.scales.x['min'] = 0;
|
||||
chart.options.scales.x['max'] = getConvertedDistance(gpxFiles.statistics.distance.total);
|
||||
chart.options.scales.x['max'] = getConvertedDistance(data.statistics.distance.total);
|
||||
|
||||
// update units
|
||||
chart.options.scales.x.title.text = `${$_('quantities.distance')} (${getDistanceUnits()})`;
|
||||
|
Reference in New Issue
Block a user