KD Chart API Documentation  3.1
KDChartCartesianGrid.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Chart library.
4 **
5 ** SPDX-FileCopyrightText: 2001 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #ifndef KDCHARTCARTESIANGRID_H
12 #define KDCHARTCARTESIANGRID_H
13 
14 #include "KDChartAbstractGrid.h"
16 
17 namespace KDChart {
18 
19 class PaintContext;
20 class CartesianCoordinatePlane;
21 
33 {
34 public:
35  CartesianGrid();
36  ~CartesianGrid() override;
37 
38  int minimalSteps() const;
39  void setMinimalSteps(int minsteps);
40 
41  int maximalSteps() const;
42  void setMaximalSteps(int maxsteps);
43 
44  void drawGrid(PaintContext *context) override;
45 
46 private:
47  int m_minsteps = 2;
48  int m_maxsteps = 12;
49 
50  DataDimensionsList calculateGrid(
51  const DataDimensionsList &rawDataDimensions) const override;
52 
66  virtual DataDimension calculateGridXY(
67  const DataDimension &rawDataDimension,
68  Qt::Orientation orientation,
69  bool adjustLower, bool adjustUpper) const;
70 
98  virtual void calculateStepWidth(
99  qreal start, qreal end,
100  const QList<qreal> &granularities,
101  Qt::Orientation orientation,
102  qreal &stepWidth, qreal &subStepWidth,
103  bool adjustLower, bool adjustUpper) const;
104 };
105 }
106 
107 #endif
void drawGrid(PaintContext *context) override
void setMaximalSteps(int maxsteps)
void setMinimalSteps(int minsteps)
Helper class for one dimension of data, e.g. for the rows in a data model, or for the labels of an ax...
Stores information about painting diagrams.
QList< DataDimension > DataDimensionsList

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated by doxygen 1.9.1