From 7c60a43ec25abc6758bc0a60018b58273c553307 Mon Sep 17 00:00:00 2001 From: IonutMuthi Date: Tue, 13 Aug 2024 10:53:10 -0400 Subject: [PATCH] datalogger: change color of plot text for print Signed-off-by: IonutMuthi --- gui/src/plotwidget.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/src/plotwidget.cpp b/gui/src/plotwidget.cpp index 73eb01e682..72928ac922 100644 --- a/gui/src/plotwidget.cpp +++ b/gui/src/plotwidget.cpp @@ -300,6 +300,10 @@ void PlotWidget::printPlot(QPainter *painter, bool useSymbols) renderer.setDiscardFlag(QwtPlotRenderer::DiscardBackground, true); renderer.setDiscardFlag(QwtPlotRenderer::DiscardCanvasBackground, true); + // Change axis and legend color + auto currentStyle = m_plot->styleSheet(); + m_plot->setStyleSheet("color: #9E9E9F"); + // Apply printable plot changes // list of current curve colors QList plotChColors; @@ -328,8 +332,8 @@ void PlotWidget::printPlot(QPainter *painter, bool useSymbols) renderer.render(m_plot, painter, QRectF(0, 0, 400, 300)); // revert changes made for printable plot - m_plot->insertLegend(nullptr); + m_plot->setStyleSheet(currentStyle); // revert curves to original settings for(int i = 0; i < getChannels().length(); i++) {