mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 16:49:42 +00:00
[Plots, Multiple-Y Axis] Fix for rectangle drawn on each axis (#6490)
* Change logic so that the rectangle is only drawn on one axis * Filter firstDrawableAxis before the rest of the logic * Update to filter yAxisIds by the canDraw function
This commit is contained in:
@ -603,20 +603,21 @@ export default {
|
|||||||
const mainYAxisId = this.config.yAxis.get('id');
|
const mainYAxisId = this.config.yAxis.get('id');
|
||||||
//There has to be at least one yAxis
|
//There has to be at least one yAxis
|
||||||
const yAxisIds = [mainYAxisId].concat(this.config.additionalYAxes.map(yAxis => yAxis.get('id')));
|
const yAxisIds = [mainYAxisId].concat(this.config.additionalYAxes.map(yAxis => yAxis.get('id')));
|
||||||
|
|
||||||
// Repeat drawing for all yAxes
|
// Repeat drawing for all yAxes
|
||||||
yAxisIds.forEach((id) => {
|
yAxisIds.filter(this.canDraw).forEach((id, yAxisIndex) => {
|
||||||
if (this.canDraw(id)) {
|
|
||||||
this.updateViewport(id);
|
this.updateViewport(id);
|
||||||
this.drawSeries(id);
|
this.drawSeries(id);
|
||||||
|
if (yAxisIndex === 0) {
|
||||||
this.drawRectangles(id);
|
this.drawRectangles(id);
|
||||||
this.drawHighlights(id);
|
}
|
||||||
|
|
||||||
|
this.drawHighlights(id);
|
||||||
// only draw these in fixed time mode or plot is paused
|
// only draw these in fixed time mode or plot is paused
|
||||||
if (this.annotationViewingAndEditingAllowed) {
|
if (this.annotationViewingAndEditingAllowed) {
|
||||||
this.drawAnnotatedPoints(id);
|
this.drawAnnotatedPoints(id);
|
||||||
this.drawAnnotationSelections(id);
|
this.drawAnnotationSelections(id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateViewport(yAxisId) {
|
updateViewport(yAxisId) {
|
||||||
|
Reference in New Issue
Block a user