File indexing completed on 2024-12-15 03:44:59
0001 /* 0002 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #include "chartutil.h" 0008 0009 #include <QtCharts/QChart> 0010 0011 #include <QApplication> 0012 0013 using namespace KUserFeedback::Console; 0014 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0015 using namespace QtCharts; 0016 #endif 0017 0018 void ChartUtil::applyTheme(QChart *chart) 0019 { 0020 chart->setTheme(qApp->palette().color(QPalette::Window).lightnessF() < 0.25 ? QChart::ChartThemeDark : QChart::ChartThemeLight); 0021 chart->setBackgroundVisible(false); 0022 }