Skip to content

Commit 6153b58

Browse files
committed
Fix period: auto
1 parent 47040c8 commit 6153b58

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/plotly-graph-card.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ export class PlotlyGraph extends HTMLElement {
268268
return [start, end + msPad];
269269
}
270270
getVisibleRange() {
271-
console.log(this.contentEl.layout.xaxis!.range);
272271
return this.contentEl.layout.xaxis!.range!.map((date) => {
273272
// if autoscale is used after scrolling, plotly returns the dates as timestamps (numbers) instead of iso strings
274273
if (Number.isFinite(date)) return date;
@@ -400,13 +399,12 @@ export class PlotlyGraph extends HTMLElement {
400399
// @TODO: cleanup how this is done
401400
if (entity.period === "auto") {
402401
entity.period = {
403-
"0": "5minute",
402+
"0s": "5minute",
404403
"1d": "hour",
405404
"7d": "day",
406-
// "28d": "week",
405+
"28d": "week",
407406
"12M": "month",
408407
};
409-
entity.period = undefined;
410408
}
411409
if (getIsPureObject(entity.period)) {
412410
entity.autoPeriod = entity.period;

0 commit comments

Comments
 (0)