diff --git a/src/plugins/plot/MctPlot.vue b/src/plugins/plot/MctPlot.vue index 8704069dd4..4bf5183453 100644 --- a/src/plugins/plot/MctPlot.vue +++ b/src/plugins/plot/MctPlot.vue @@ -353,10 +353,8 @@ export default { this.config = this.getConfig(); this.legend = this.config.legend; - if (this.isNestedWithinAStackedPlot) { - const configId = this.openmct.objects.makeKeyString(this.domainObject.identifier); - this.$emit('configLoaded', configId); - } + const configId = this.openmct.objects.makeKeyString(this.domainObject.identifier); + this.$emit('configLoaded', configId); this.listenTo(this.config.series, 'add', this.addSeries, this); this.listenTo(this.config.series, 'remove', this.removeSeries, this); diff --git a/src/plugins/plot/inspector/PlotOptions.vue b/src/plugins/plot/inspector/PlotOptions.vue index a72fcb8c9a..5bcbc5f09b 100644 --- a/src/plugins/plot/inspector/PlotOptions.vue +++ b/src/plugins/plot/inspector/PlotOptions.vue @@ -38,7 +38,7 @@ export default { PlotOptionsBrowse, PlotOptionsEdit }, - inject: ['openmct', 'domainObject'], + inject: ['openmct', 'domainObject', 'path'], data() { return { isEditing: this.openmct.editor.isEditing() diff --git a/src/plugins/plot/legend/PlotLegend.vue b/src/plugins/plot/legend/PlotLegend.vue index 1bdf4b3bb9..01054b1958 100644 --- a/src/plugins/plot/legend/PlotLegend.vue +++ b/src/plugins/plot/legend/PlotLegend.vue @@ -50,7 +50,7 @@ > { this.data = data; } @@ -183,6 +185,10 @@ export default { this.domainObject.configuration.series.splice(configIndex, 1); } + this.removeSeries({ + keyString: id + }); + const childObj = this.compositionObjects.filter((c) => { const identifier = this.openmct.objects.makeKeyString(c.identifier); @@ -244,18 +250,29 @@ export default { this.highlights = data; }, registerSeriesListeners(configId) { - this.seriesConfig[configId] = this.getConfig(configId); - this.listenTo(this.seriesConfig[configId].series, 'add', this.addSeries, this); - this.listenTo(this.seriesConfig[configId].series, 'remove', this.removeSeries, this); + const config = this.getConfig(configId); + this.seriesConfig[configId] = config; + const childObject = config.get('domainObject'); - this.seriesConfig[configId].series.models.forEach(this.addSeries, this); + //TODO differentiate between objects with composition and those without + if (childObject.type === 'telemetry.plot.overlay') { + this.listenTo(config.series, 'add', this.addSeries, this); + this.listenTo(config.series, 'remove', this.removeSeries, this); + } + + config.series.models.forEach(this.addSeries, this); }, addSeries(series) { - const index = this.seriesModels.length; - this.$set(this.seriesModels, index, series); + const childObject = series.domainObject; + //don't add the series if it can have child series this will happen in registerSeriesListeners + if (childObject.type !== 'telemetry.plot.overlay') { + const index = this.seriesModels.length; + this.$set(this.seriesModels, index, series); + } + }, removeSeries(plotSeries) { - const index = this.seriesModels.findIndex(seriesModel => this.openmct.objects.areIdsEqual(seriesModel.identifier, plotSeries.identifier)); + const index = this.seriesModels.findIndex(seriesModel => seriesModel.keyString === plotSeries.keyString); if (index > -1) { this.$delete(this.seriesModels, index); } diff --git a/src/plugins/plot/stackedPlot/StackedPlotItem.vue b/src/plugins/plot/stackedPlot/StackedPlotItem.vue index b0049a3613..e7ec5b8f46 100644 --- a/src/plugins/plot/stackedPlot/StackedPlotItem.vue +++ b/src/plugins/plot/stackedPlot/StackedPlotItem.vue @@ -133,6 +133,7 @@ export default { //If this object is not persistable, then package it with it's parent const object = this.getPlotObject(); + const getProps = this.getProps; const isMissing = openmct.objects.isMissing(object); let viewContainer = document.createElement('div'); @@ -160,7 +161,7 @@ export default { onGridLinesChange, setStatus, isMissing, - loading: true + loading: false }; }, methods: {