Skip to content

Commit b7885de

Browse files
authored
Merge pull request #1979 from OpenC3/graph_scaling
Fix Graph without overview
2 parents c0e986b + 8022719 commit b7885de

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components/Graph.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# GNU Affero General Public License for more details.
1414
1515
# Modified by OpenC3, Inc.
16-
# All changes Copyright 2024, OpenC3, Inc.
16+
# All changes Copyright 2025, OpenC3, Inc.
1717
# All Rights Reserved
1818
#
1919
# This file may also be used under the terms of a commercial license
@@ -766,11 +766,13 @@ export default {
766766
],
767767
},
768768
}
769-
this.overview = new uPlot(
770-
overviewOpts,
771-
this.data,
772-
document.getElementById(`overview${this.id}`),
773-
)
769+
if (!this.hideOverview) {
770+
this.overview = new uPlot(
771+
overviewOpts,
772+
this.data,
773+
document.getElementById(`overview${this.id}`),
774+
)
775+
}
774776
this.moveLegend(this.legendPosition)
775777
776778
// Allow the charts to dynamically resize when the window resizes
@@ -1442,7 +1444,9 @@ export default {
14421444
if (this.data.length === 2) {
14431445
this.data[0] = []
14441446
this.graph.setData(this.data)
1445-
this.overview.setData(this.data)
1447+
if (this.overview) {
1448+
this.overview.setData(this.data)
1449+
}
14461450
}
14471451
},
14481452
removeItems: function (itemArray) {
@@ -1464,7 +1468,9 @@ export default {
14641468
if (this.data.length === 1) {
14651469
this.data[0] = []
14661470
this.graph.setData(this.data)
1467-
this.overview.setData(this.data)
1471+
if (this.overview) {
1472+
this.overview.setData(this.data)
1473+
}
14681474
}
14691475
this.$emit('resize')
14701476
this.$emit('edit')

openc3-cosmos-init/plugins/packages/openc3-vue-common/src/widgets/HorizontalboxWidget.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<template>
2424
<div>
2525
<label-widget
26+
v-if="parameters.length > 0"
2627
:parameters="parameters.slice(0, 1)"
2728
:settings="[...labelSettings]"
2829
:widget-index="0"

openc3-cosmos-init/plugins/packages/openc3-vue-common/src/widgets/VerticalboxWidget.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<template>
2424
<div>
2525
<label-widget
26+
v-if="parameters.length > 0"
2627
:parameters="parameters.slice(0, 1)"
2728
:settings="[...labelSettings]"
2829
:widget-index="0"

0 commit comments

Comments
 (0)