Skip to content

Commit 2123d4a

Browse files
author
David Buezas
committed
fixes wrong yaxis range when using multiple axes and show_value
1 parent 461f312 commit 2123d4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/plotly-graph-card.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export class PlotlyGraph extends HTMLElement {
307307

308308
return entities.flatMap((trace, traceIdx) => {
309309
const entity_id = trace.entity;
310-
const history = histories[entity_id] || {};
310+
const history = histories[entity_id] || [];
311311
const attribute = attributes[entity_id] || {};
312312
const unit = this.getUnitOfMeasurement(entity_id);
313313
const yaxis_idx = units.indexOf(unit);
@@ -375,6 +375,7 @@ export class PlotlyGraph extends HTMLElement {
375375
mergedTrace.show_value.right_margin *
376376
((this.config.hours_to_show * 1000 * 60 * 60) / 100);
377377
traces.push({
378+
...mergedTrace,
378379
legendgroup: "group" + traceIdx,
379380
marker: {
380381
color: "transparent",

0 commit comments

Comments
 (0)