Skip to content

Commit

Permalink
fix: display was wrong when using server time + serie offset
Browse files Browse the repository at this point in the history
Closes #579
  • Loading branch information
RomRider committed Jul 4, 2024
1 parent 1b864c9 commit 84357f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/apexcharts-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,11 +833,10 @@ class ChartsCard extends LitElement {
return;
}
let data: EntityCachePoints = [];
const offset = (this._seriesOffset[index] || 0) - (this._seriesTimeDelta[index] || 0);
const offset =
this._serverTimeOffset + (this._seriesOffset[index] || 0) - (this._seriesTimeDelta[index] || 0);
if (offset) {
data = offsetData(graph.history, offset);
} else if (this._serverTimeOffset) {
data = offsetData(graph.history, this._serverTimeOffset);
} else {
data = [...graph.history];
}
Expand Down

0 comments on commit 84357f9

Please sign in to comment.