web: Sort data in simple measure graphs.
This commit is contained in:
parent
8af6c65c9b
commit
74b8a42d29
@ -22,11 +22,13 @@ export class SimpleDetails extends Vue {
|
||||
};
|
||||
|
||||
private get measurementChartData(): ApexAxisChartSeries {
|
||||
const measurementData = this.measurements || [];
|
||||
const measurementData = this.measurements.slice() || [];
|
||||
|
||||
return [{
|
||||
name: this.measure.name,
|
||||
data: measurementData.map((m) => ({ x: m.timestamp.toISOString(), y: m.value }))
|
||||
data: measurementData
|
||||
.sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime())
|
||||
.map((m) => ({ x: m.timestamp.toISOString(), y: m.value }))
|
||||
}];
|
||||
}
|
||||
|
||||
|
@ -16,11 +16,13 @@ export class SimpleSummaryGraph extends Vue {
|
||||
};
|
||||
|
||||
private get measurementData(): ApexAxisChartSeries {
|
||||
const measurementData = this.measurements || [];
|
||||
let measurementData = this.measurements.slice() || [];
|
||||
|
||||
return [{
|
||||
name: this.measure.name,
|
||||
data: measurementData.map((m) => ({ x: m.timestamp.toISOString(), y: m.value }))
|
||||
data: measurementData
|
||||
.sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime())
|
||||
.map((m) => ({ x: m.timestamp.toISOString(), y: m.value }))
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user