Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 50842: Fix upper and lower bounds legends on qc plots #948

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions webapp/TargetedMS/js/LeveyJenningsPlotHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,15 @@ Ext4.define("LABKEY.targetedms.LeveyJenningsPlotHelper", {
return ['value_series1', 'value_series2'];
},

getLJLegend: function () {
getLJLegend: function (combinedPlot) {
var ljLegend = [];

if (!this.getMetricPropsById(this.metric).series2Label) {
let metricInfo = this.getMetricPropsById(this.metric);

if (metricInfo.metricStatus === LABKEY.targetedms.MetricStatus.ValueCutoff || metricInfo.metricStatus === LABKEY.targetedms.MetricStatus.MeanDeviationCutoff) {
let isCombinedValueCutOff = LABKEY.targetedms.MetricStatus.ValueCutoff && combinedPlot;
let isYAxisScaleLinearOrLog = this.yAxisScale === 'linear' || this.yAxisScale === 'log';
let showLegend = (isYAxisScaleLinearOrLog && isCombinedValueCutOff) || !isCombinedValueCutOff;
if (showLegend|| metricInfo.metricStatus === LABKEY.targetedms.MetricStatus.MeanDeviationCutoff) {
if (Number.isFinite(metricInfo.upperBound)) {
ljLegend.push({
text: 'Upper: ' + metricInfo.upperBound,
Expand Down
4 changes: 2 additions & 2 deletions webapp/TargetedMS/js/QCPlotHelperBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ Ext4.define("LABKEY.targetedms.QCPlotHelperBase", {
newLegendData = newLegendData.concat(ionLegend);
}

var extraPlotLegendData = this.getAdditionalPlotLegend(plotType);
var extraPlotLegendData = this.getAdditionalPlotLegend(plotType, true);
newLegendData = newLegendData.concat(extraPlotLegendData);

return newLegendData;
Expand Down Expand Up @@ -856,7 +856,7 @@ Ext4.define("LABKEY.targetedms.QCPlotHelperBase", {

Ext4.apply(trendLineProps, this.getPlotTypeProperties(precursorInfo, plotType, isCUSUMMean, metricProps));

var plotLegendData = this.getAdditionalPlotLegend(plotType);
var plotLegendData = this.getAdditionalPlotLegend(plotType, false);
if (Ext4.isArray(this.legendData)) {
plotLegendData = plotLegendData.concat(this.legendData);
}
Expand Down
4 changes: 2 additions & 2 deletions webapp/TargetedMS/js/QCPlotHelperWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,13 @@ Ext4.define("LABKEY.targetedms.QCPlotHelperWrapper", {
return this.getLJCombinedPlotLegendSeries();
},

getAdditionalPlotLegend: function(plotType) {
getAdditionalPlotLegend: function(plotType, combinedPlot) {
if (plotType === LABKEY.vis.TrendingLinePlotType.CUSUM)
return this.getCUSUMGroupLegend();
if (plotType === LABKEY.vis.TrendingLinePlotType.MovingRange)
return this.getMRLegend();
if (plotType === LABKEY.vis.TrendingLinePlotType.LeveyJennings)
return this.getLJLegend();
return this.getLJLegend(combinedPlot);
if (this.showMeanCUSUMPlot() || this.showVariableCUSUMPlot() ||
plotType === LABKEY.vis.TrendingLinePlotType.TrailingMean ||
plotType === LABKEY.vis.TrendingLinePlotType.TrailingCV)
Expand Down