KChart

KChartTernaryGrid.h
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KD Chart library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KCHARTTERNARYGRID_H
10#define KCHARTTERNARYGRID_H
11
12#include <QList>
13
14#include "KChartAbstractGrid.h"
15#include "KChartTextLabelCache.h"
16
17namespace KChart {
18
19 struct TickInfo {
20 TickInfo( qreal percentage = 0, int depth = 0 );
21 qreal percentage;
22 int depth;
23 };
24
25 bool operator==(const TickInfo&, const TickInfo& );
26
27 class PaintContext;
28
29 // VERIFY: Grids are not public API, are they?
30 class TernaryGrid : public AbstractGrid
31 {
32 public:
33 TernaryGrid();
34
35 ~TernaryGrid() override;
36
37 void drawGrid( PaintContext* context ) override;
38 DataDimensionsList calculateGrid( const DataDimensionsList& rawDataDimensions ) const override;
39
40 /** Returns two QSizeF objects specifying the dimension of the
41 margins needed between each corner of the diagram and the
42 border of the drawing area. Margins are required because
43 the tick marks are placed outside of the trianges
44 containing rectangle.
45 The margins are returned in <em>diagram coordinates</em>,
46 since the grid does not know about widget coordinates.
47 */
48 QPair<QSizeF, QSizeF> requiredMargins() const;
49 /** Return the locations of the grid lines, so that axes can
50 draw axis rulers at the correct positions.
51 This information is valid after the grid has been
52 painted (that is, the axes need to be painted after the
53 grid. */
54 const QVector<TickInfo>& tickInfo() const;
55 private:
56 QVector<TickInfo> m_tickInfo;
57 // QList<PrerenderedLabel> m_labels;
58 };
59
60}
61
62#endif
bool operator==(const StyleDelim &l, const StyleDelim &r)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.