File indexing completed on 2024-12-15 04:02:31
0001 /* 0002 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. 0003 * 0004 * This file is part of the KD Chart library. 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef KCHARTLEVEYJENNINGSGRID_H 0010 #define KCHARTLEVEYJENNINGSGRID_H 0011 0012 #include "KChartCartesianGrid.h" 0013 0014 namespace KChart { 0015 0016 class PaintContext; 0017 0018 /** 0019 * \internal 0020 * 0021 * \brief Class for the grid in a Levey Jennings plane. 0022 * 0023 * The LeveyJenningsGrid interface is used 0024 * for calculating and for drawing 0025 * the horizontal grid lines, and the vertical grid lines 0026 * of a Levey Jennings coordinate plane. 0027 */ 0028 class LeveyJenningsGrid : public CartesianGrid 0029 { 0030 public: 0031 LeveyJenningsGrid() : CartesianGrid() {} 0032 ~LeveyJenningsGrid() override {} 0033 0034 void drawGrid( PaintContext* context ) override; 0035 0036 private: 0037 DataDimensionsList calculateGrid( const DataDimensionsList& rawDataDimensions ) const override; 0038 DataDimension calculateGridXY( const DataDimension& rawDataDimension, 0039 Qt::Orientation orientation, bool adjustLower, bool adjustUpper ) const override; 0040 void calculateStepWidth( qreal start_, qreal end_, const QList<qreal>& granularities, Qt::Orientation orientation, 0041 qreal& stepWidth, qreal& subStepWidth, bool adjustLower, bool adjustUpper ) const override; 0042 }; 0043 0044 } 0045 0046 #endif