Commit 920804c358b72b2fdd1fb35881d47539c125f39c
1 parent
6c4b6a4f
Exists in
master
and in
11 other branches
Fix
Showing
2 changed files
with
13 additions
and
14 deletions
Show diff stats
src/ParamOutputImpl/Plot/AxisLegendManager.cc
... | ... | @@ -53,8 +53,7 @@ namespace plot |
53 | 53 | if(param.getHistogramSeriesPropertiesList().size() > 0) |
54 | 54 | compLegendColor = pHistogramProperties->getColor(); |
55 | 55 | ParameterIndexComponentColor xIndex = ParameterIndexComponentColor(xIndexComp, compLegendColor); |
56 | - pushComponentInList(xParamId, xIndex, axesParamsComponents[xAxisId]); | |
57 | - insertionOrder.push_back(xParamId); | |
56 | + pushComponentInList(xParamId, xIndex, axesParamsComponents[xAxisId], insertionOrder); | |
58 | 57 | } |
59 | 58 | } |
60 | 59 | |
... | ... | @@ -84,8 +83,7 @@ namespace plot |
84 | 83 | } |
85 | 84 | |
86 | 85 | ParameterIndexComponentColor xIndex = ParameterIndexComponentColor(xSerie.getIndex(), compLegendColor); |
87 | - pushComponentInList(xSerie.getParamId(), xIndex, axesParamsComponents[xAxisId]); | |
88 | - insertionOrder.push_back(xSerie.getParamId()); | |
86 | + pushComponentInList(xSerie.getParamId(), xIndex, axesParamsComponents[xAxisId], insertionOrder); | |
89 | 87 | } |
90 | 88 | } |
91 | 89 | |
... | ... | @@ -184,8 +182,7 @@ namespace plot |
184 | 182 | if(param.getHistogramSeriesPropertiesList().size() > 0) |
185 | 183 | compLegendColor = pHistogramProperties->getColor(); |
186 | 184 | ParameterIndexComponentColor yIndex = ParameterIndexComponentColor(yIndexComp, compLegendColor); |
187 | - pushComponentInList(yParamId, yIndex, axesHistoParamsComponents[yAxisId]); | |
188 | - insertionOrder.push_back(yParamId); | |
185 | + pushComponentInList(yParamId, yIndex, axesHistoParamsComponents[yAxisId], insertionOrder); | |
189 | 186 | } |
190 | 187 | } |
191 | 188 | for (auto lSeriesProperties : param.getYSeriePropertiesList()) |
... | ... | @@ -210,8 +207,7 @@ namespace plot |
210 | 207 | compLegendColor = plot->getSerieLineColor(lSeriesProperties, moreThanOneSerieForAxis); |
211 | 208 | } |
212 | 209 | ParameterIndexComponentColor yIndex = ParameterIndexComponentColor(index, compLegendColor); |
213 | - pushComponentInList(lSeriesProperties.getParamId(), yIndex, axesParamsComponents[yAxisId]); | |
214 | - insertionOrder.push_back(lSeriesProperties.getParamId()); | |
210 | + pushComponentInList(lSeriesProperties.getParamId(), yIndex, axesParamsComponents[yAxisId], insertionOrder); | |
215 | 211 | } |
216 | 212 | } |
217 | 213 | } |
... | ... | @@ -273,8 +269,7 @@ namespace plot |
273 | 269 | ParameterIndexComponentColor colorSerieIndex = ParameterIndexComponentColor(-1, -1, lZAxis->_color); |
274 | 270 | if (pHistogramProperties->getHistotypeProperties().getIndex() > -1) |
275 | 271 | colorSerieIndex = ParameterIndexComponentColor(pHistogramProperties->getHistotypeProperties().getIndex(), -1, lZAxis->_color); |
276 | - pushComponentInList(pHistogramProperties->getHistotypeProperties().getParamId(), colorSerieIndex, axisParamsComponents); | |
277 | - insertionOrder.push_back(pHistogramProperties->getHistotypeProperties().getParamId()); | |
272 | + pushComponentInList(pHistogramProperties->getHistotypeProperties().getParamId(), colorSerieIndex, axisParamsComponents, insertionOrder); | |
278 | 273 | } |
279 | 274 | } |
280 | 275 | for (auto lSeriesProperties : param.getYSeriePropertiesList()) |
... | ... | @@ -298,8 +293,7 @@ namespace plot |
298 | 293 | ParameterIndexComponentColor colorSerieIndex = ParameterIndexComponentColor(-1, -1, lZAxis->_color); |
299 | 294 | if (lColorSerieProperties.getIndex() > -1) |
300 | 295 | colorSerieIndex = ParameterIndexComponentColor(lColorSerieProperties.getIndex(), -1, lZAxis->_color); |
301 | - pushComponentInList(lColorSerieProperties.getColorParamIds()[yParamId], colorSerieIndex, axisParamsComponents); | |
302 | - insertionOrder.push_back(lColorSerieProperties.getColorParamIds()[yParamId]); | |
296 | + pushComponentInList(lColorSerieProperties.getColorParamIds()[yParamId], colorSerieIndex, axisParamsComponents, insertionOrder); | |
303 | 297 | } |
304 | 298 | } |
305 | 299 | |
... | ... | @@ -343,13 +337,16 @@ namespace plot |
343 | 337 | } |
344 | 338 | } |
345 | 339 | |
346 | - void AxisLegendManager::pushComponentInList(std::string paramId, ParameterIndexComponentColor &index, AxisParamsComponents &axisParamsComponents) | |
340 | + void AxisLegendManager::pushComponentInList(std::string paramId, ParameterIndexComponentColor &index, AxisParamsComponents &axisParamsComponents, | |
341 | + std::vector<std::string> &insertionOrder) | |
347 | 342 | { |
348 | 343 | if (index.getDim1Index() == -1 && index.getDim2Index() == -1) |
349 | 344 | { |
350 | 345 | // All indexes of this parameter are used |
351 | 346 | axisParamsComponents[paramId].clear(); |
352 | 347 | axisParamsComponents[paramId].push_back(index); |
348 | + if (std::find(insertionOrder.begin(), insertionOrder.end(), paramId) == insertionOrder.end()) | |
349 | + insertionOrder.push_back(paramId); | |
353 | 350 | } |
354 | 351 | else |
355 | 352 | { |
... | ... | @@ -371,6 +368,8 @@ namespace plot |
371 | 368 | } |
372 | 369 | // Add this components for this axis |
373 | 370 | axisParamsComponents[paramId].push_back(index); |
371 | + if (std::find(insertionOrder.begin(), insertionOrder.end(), paramId) == insertionOrder.end()) | |
372 | + insertionOrder.push_back(paramId); | |
374 | 373 | } |
375 | 374 | } |
376 | 375 | ... | ... |
src/ParamOutputImpl/Plot/AxisLegendManager.hh
... | ... | @@ -93,7 +93,7 @@ namespace plot |
93 | 93 | |
94 | 94 | static void addBreakLine(std::string &legend); |
95 | 95 | |
96 | - static void pushComponentInList(std::string paramId, ParameterIndexComponentColor &index, AxisParamsComponents &axisParamsComponents); | |
96 | + static void pushComponentInList(std::string paramId, ParameterIndexComponentColor &index, AxisParamsComponents &axisParamsComponents, std::vector<std::string> &insertionOrder); | |
97 | 97 | |
98 | 98 | static std::string getParamLegend(AMDA::Info::ParamInfoSPtr paramInfo, ParameterIndexComponentColor &index); |
99 | 99 | ... | ... |