diff --git a/src/cuteControl.h b/src/cuteControl.h index 75040141b1e4a240ea75e078f2400aeee6f47784..d8e58e9870b43db367cc75551ed5b7f339786015 100644 --- a/src/cuteControl.h +++ b/src/cuteControl.h @@ -144,7 +144,8 @@ public: tooltip.replace(tooltip.find("@X"), 2, "%1"); tooltip.replace(tooltip.find("@Y"), 2, "%2"); } - emit s_plotXYSeries(s, plot, properties.onTop, properties.legend, tooltip.c_str()); + bool legend = properties.legend & !properties.name.empty(); + emit s_plotXYSeries(s, plot, properties.onTop, legend, tooltip.c_str()); } void plotValues(std::vector<float>& values, int plot, const cute::PlotProperties& properties = {}) @@ -179,7 +180,8 @@ public: series->setName(properties.name.c_str()); series->moveToThread(QApplication::instance()->thread()); - emit s_plotBarSeries(series, plot, properties.onTop, properties.legend); + bool legend = properties.legend & !properties.name.empty(); + emit s_plotBarSeries(series, plot, properties.onTop, legend); } void highlightValue(float value, int plot, const cute::Color& color) @@ -221,7 +223,8 @@ public: s->setPen(pen); s->setName(properties.name.c_str()); s->moveToThread(QApplication::instance()->thread()); - emit s_plotXYSeries(s, plot, properties.onTop, properties.legend); + bool legend = properties.legend & !properties.name.empty(); + emit s_plotXYSeries(s, plot, properties.onTop, legend); } void resetPlot(int plot) { emit s_resetPlot(plot); }