Skip to content

Commit

Permalink
fix chart for new type of measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4tim committed Sep 26, 2024
1 parent 12735d8 commit 762d04f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/sensor/Chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ export default {
remote - setData */
v.forEach((newdata, i) => {
this.chartObj.series[i].setData(newdata.data, false);
const id = this.chartObj.series.findIndex((m) => m.name === newdata.name);
if (id >= 0) {
this.chartObj.series[i].setData(newdata.data, false);
} else {
this.chartObj.addSeries(newdata);
}
});
this.chartObj.redraw();
Expand Down

0 comments on commit 762d04f

Please sign in to comment.