QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
qgslinechartplot.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslinechartplot.h
3 ------------------
4 begin : June 2025
5 copyright : (C) 2025 by Mathieu
6 email : mathieu at opengis dot ch
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSLINECHARTPLOT_H
18#define QGSLINECHARTPLOT_H
19
20#include "qgis_core.h"
21#include "qgis_sip.h"
22#include "qgslinesymbol.h"
23#include "qgsmarkersymbol.h"
24#include "qgsplot.h"
25
27
28
37class CORE_EXPORT QgsLineChartPlot : public Qgs2DXyPlot
38{
39 public:
40
42 ~QgsLineChartPlot() override = default;
43
44 QString type() const override { return QStringLiteral( "line" ); }
45
46 void renderContent( QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QRectF &plotArea, const QgsPlotData &plotData = QgsPlotData() ) override;
47
48 bool writeXml( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const override;
49 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
50
54 QgsMarkerSymbol *markerSymbolAt( int index ) const;
55
59 void setMarkerSymbolAt( int index, QgsMarkerSymbol *symbol SIP_TRANSFER );
60
64 int markerSymbolCount() const { return mMarkerSymbols.size(); }
65
69 QgsLineSymbol *lineSymbolAt( int index ) const;
70
74 void setLineSymbolAt( int index, QgsLineSymbol *symbol SIP_TRANSFER );
75
79 int lineSymbolCount() const { return mLineSymbols.size(); }
80
82 static QgsLineChartPlot *create() SIP_FACTORY;
83
85 static QgsVectorLayerAbstractPlotDataGatherer *createDataGatherer( QgsPlot *plot ) SIP_TRANSFERBACK;
86
87 private:
88
89 std::vector<std::unique_ptr<QgsMarkerSymbol>> mMarkerSymbols;
90 std::vector<std::unique_ptr<QgsLineSymbol>> mLineSymbols;
91};
92
93#endif // QGSLINECHARTPLOT_H
virtual void renderContent(QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QRectF &plotArea, const QgsPlotData &plotData=QgsPlotData())
Renders the plot content.
Definition qgsplot.cpp:263
bool readXml(const QDomElement &element, const QgsReadWriteContext &context) override
Reads the plot's properties from an XML element.
Definition qgsplot.cpp:390
Qgs2DXyPlot()
Constructor for Qgs2DXyPlot.
Definition qgsplot.cpp:356
bool writeXml(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override
Writes the plot's properties into an XML element.
Definition qgsplot.cpp:364
A simple line chart class.
int lineSymbolCount() const
Returns the line symbols list count.
QString type() const override
Returns the plot's type.
~QgsLineChartPlot() override=default
int markerSymbolCount() const
Returns the line symbols list count.
A line symbol type, for rendering LineString and MultiLineString geometries.
A marker symbol type, for rendering Point and MultiPoint geometries.
Encapsulates one or more plot series.
Definition qgsplot.h:300
Contains information about the context of a plot rendering operation.
Definition qgsplot.h:184
Base class for plot/chart/graphs.
Definition qgsplot.h:48
A container for the context for various read/write operations on objects.
Contains information about the context of a rendering operation.
An abstract vector layer plot data gatherer base class.
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48
#define SIP_FACTORY
Definition qgis_sip.h:84