Skip to content

Commit 5f629aa

Browse files
committed
fix: set default coords to -1
1 parent 4c70bbf commit 5f629aa

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Framework/include/QualityControl/TrendingTaskConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct TrendingTaskConfig : PostProcessingConfig {
6565
// legend configuration
6666
struct LegendConfig {
6767
int nColumns{ 1 };
68-
float x1{ 0.30f }, y1{ 0.20f }, x2{ 0.55f }, y2{ 0.35f }; // NDC coords
68+
float x1{ -1.f }, y1{ -1.f }, x2{ -1.f }, y2{ -1.f }; // NDC coords
6969
};
7070

7171
// this corresponds to one canvas which can include multiple graphs

Framework/src/TrendingTask.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ TCanvas* TrendingTask::drawPlot(const TrendingTaskConfig::Plot& plotConfig)
347347

348348
// Legend
349349
TLegend* legend = nullptr;
350-
if (plotConfig.legend.x1 && plotConfig.legend.y1 && plotConfig.legend.x2 && plotConfig.legend.y2) {
350+
if (plotConfig.legend.x1 >= 0 && plotConfig.legend.y1 >= 0 && plotConfig.legend.x2 >= 0 && plotConfig.legend.y2 >= 0) {
351351
legend = new TLegend(plotConfig.legend.x1, plotConfig.legend.y1,
352352
plotConfig.legend.x2, plotConfig.legend.y2,
353-
/*header=*/nullptr, /*option=*/"NDC");
353+
nullptr, "NDC");
354354
if (plotConfig.legend.nColumns > 0) {
355355
legend->SetNColumns(plotConfig.legend.nColumns);
356356
}

Framework/src/TrendingTaskConfig.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ TrendingTaskConfig::TrendingTaskConfig(std::string id, const boost::property_tre
7474

7575
LegendConfig leg;
7676
leg.nColumns = plotConfig.get<int>("legend.nColumns", 1);
77-
leg.x1 = plotConfig.get<float>("legend.x1", 0.30f);
78-
leg.y1 = plotConfig.get<float>("legend.y1", 0.20f);
79-
leg.x2 = plotConfig.get<float>("legend.x2", 0.55f);
80-
leg.y2 = plotConfig.get<float>("legend.y2", 0.35f);
77+
leg.x1 = plotConfig.get<float>("legend.x1", -1.f);
78+
leg.y1 = plotConfig.get<float>("legend.y1", -1.f);
79+
leg.x2 = plotConfig.get<float>("legend.x2", -1.f);
80+
leg.y2 = plotConfig.get<float>("legend.y2", -1.f);
8181

8282
plots.push_back({ plotConfig.get<std::string>("name"),
8383
plotConfig.get<std::string>("title", ""),

0 commit comments

Comments
 (0)