Skip to content

Commit 4a11425

Browse files
committed
Removed Error Second Version
1 parent 872bf75 commit 4a11425

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

moongui/src/app/graph/graph-histogram/graph-histogram.component.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ export class GraphHistogramComponent implements OnChanges, AfterViewInit {
101101
type: 'histogram',
102102
autobinx: false,
103103
xbins: {
104-
start: this.arrayMin(this.points[i].x),
105-
end: this.arrayMax(this.points[i].x),
104+
start: 0,
105+
end: 100,
106106
size: this.size
107107
}
108108
});
@@ -119,11 +119,13 @@ export class GraphHistogramComponent implements OnChanges, AfterViewInit {
119119
let update1: any = {x: [], xbins: []};
120120
for (let i: number = 0; i < changes.points.currentValue.length; i++) {
121121
update1.x.push(changes.points.currentValue[i].x);//Calculates the changes for each trace again
122-
update1.xbins.push({
123-
start: this.arrayMin(changes.points.currentValue[i].x),
124-
end: this.arrayMax(changes.points.currentValue[i].x),
125-
size: this.size
126-
});
122+
if(changes.points.currentValue[i].x!=[] && changes.points.currentValue[i].x.length>=0) {
123+
update1.xbins.push({
124+
start: this.arrayMin(changes.points.currentValue[i].x),
125+
end: this.arrayMax(changes.points.currentValue[i].x),
126+
size: this.size
127+
});
128+
}
127129
}
128130
Plotly.restyle(graphDiv, update1);//Update and change range of percentile, if wanted
129131
if (this.xAxisPercentile && !this.layout.xaxis.autorange) {

0 commit comments

Comments
 (0)