Skip to content

Commit

Permalink
#178 - fix graph clearing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RChandler234 committed Sep 14, 2024
1 parent be95ec9 commit f0cd163
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class GraphPage implements OnInit {

this.setSelectedDataType = (dataType: DataType) => {
this.selectedDataType.next(dataType);
this.selectedDataTypeValuesSubject.next([]);
this.selectedDataTypeValuesSubject = new BehaviorSubject<GraphData[]>([]);
if (this.realTime) {
if (this.subscription) this.subscription.unsubscribe();
const key = dataType.name;
Expand Down
9 changes: 9 additions & 0 deletions angular-client/src/pages/graph-page/graph/graph.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ export default class Graph implements OnChanges {
this.data = new Map();
this.isSliding = false;

//set range to undefined
this.chart.updateOptions({
...this.options,
xaxis: {
...this.options.xaxis,
range: undefined
}
});

this.valuesSubject.subscribe((values: GraphData[]) => {
values.forEach((value) => {
if (!this.data.has(value.x)) {
Expand Down

0 comments on commit f0cd163

Please sign in to comment.