QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
plot
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
26
#include <QString>
27
28
using namespace
Qt::StringLiterals;
29
30
class
QgsVectorLayerAbstractPlotDataGatherer
;
31
32
41
class
CORE_EXPORT
QgsLineChartPlot
:
public
Qgs2DXyPlot
42
{
43
public
:
44
QgsLineChartPlot
();
45
~QgsLineChartPlot
()
override
=
default
;
46
47
QString
type
()
const override
{
return
u
"line"
_s; }
48
49
void
renderContent
(
QgsRenderContext
&context,
QgsPlotRenderContext
&plotContext,
const
QRectF &plotArea,
const
QgsPlotData
&plotData =
QgsPlotData
() )
override
;
50
51
bool
writeXml
( QDomElement &element, QDomDocument &document,
const
QgsReadWriteContext
&context )
const override
;
52
bool
readXml
(
const
QDomElement &element,
const
QgsReadWriteContext
&context )
override
;
53
57
QgsMarkerSymbol
*markerSymbolAt(
int
index )
const
;
58
62
void
setMarkerSymbolAt(
int
index,
QgsMarkerSymbol
*symbol
SIP_TRANSFER
);
63
67
int
markerSymbolCount
()
const
{
return
mMarkerSymbols.size(); }
68
72
QgsLineSymbol
*lineSymbolAt(
int
index )
const
;
73
77
void
setLineSymbolAt(
int
index,
QgsLineSymbol
*symbol
SIP_TRANSFER
);
78
82
int
lineSymbolCount
()
const
{
return
mLineSymbols.size(); }
83
85
static
QgsLineChartPlot
*create()
SIP_FACTORY
;
86
88
static
QgsVectorLayerAbstractPlotDataGatherer
*createDataGatherer(
QgsPlot
*plot )
SIP_TRANSFERBACK
;
89
94
void
initFromPlot( const
QgsPlot
*plot ) override;
95
96
private:
97
std::vector<std::unique_ptr<
QgsMarkerSymbol
>> mMarkerSymbols;
98
std::vector<std::unique_ptr<
QgsLineSymbol
>> mLineSymbols;
99
};
100
101
#endif
// QGSLINECHARTPLOT_H
Qgs2DPlot::renderContent
virtual void renderContent(QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QRectF &plotArea, const QgsPlotData &plotData=QgsPlotData())
Renders the plot content.
Definition
qgsplot.cpp:310
Qgs2DXyPlot::readXml
bool readXml(const QDomElement &element, const QgsReadWriteContext &context) override
Reads the plot's properties from an XML element.
Definition
qgsplot.cpp:450
Qgs2DXyPlot::Qgs2DXyPlot
Qgs2DXyPlot()
Constructor for Qgs2DXyPlot.
Definition
qgsplot.cpp:414
Qgs2DXyPlot::writeXml
bool writeXml(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override
Writes the plot's properties into an XML element.
Definition
qgsplot.cpp:422
QgsLineChartPlot
A simple line chart class.
Definition
qgslinechartplot.h:42
QgsLineChartPlot::QgsLineChartPlot
QgsLineChartPlot()
Definition
qgslinechartplot.cpp:31
QgsLineChartPlot::lineSymbolCount
int lineSymbolCount() const
Returns the line symbols list count.
Definition
qgslinechartplot.h:82
QgsLineChartPlot::type
QString type() const override
Returns the plot's type.
Definition
qgslinechartplot.h:47
QgsLineChartPlot::~QgsLineChartPlot
~QgsLineChartPlot() override=default
QgsLineChartPlot::markerSymbolCount
int markerSymbolCount() const
Returns the line symbols list count.
Definition
qgslinechartplot.h:67
QgsLineSymbol
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition
qgslinesymbol.h:30
QgsMarkerSymbol
A marker symbol type, for rendering Point and MultiPoint geometries.
Definition
qgsmarkersymbol.h:31
QgsPlotData
Encapsulates one or more plot series.
Definition
qgsplot.h:303
QgsPlotRenderContext
Contains information about the context of a plot rendering operation.
Definition
qgsplot.h:191
QgsPlot
Base class for plot/chart/graphs.
Definition
qgsplot.h:48
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsRenderContext
Contains information about the context of a rendering operation.
Definition
qgsrendercontext.h:63
QgsVectorLayerAbstractPlotDataGatherer
An abstract vector layer plot data gatherer base class.
Definition
qgsvectorlayerplotdatagatherer.h:36
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition
qgis_sip.h:35
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition
qgis_sip.h:47
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgslinesymbol.h
qgsmarkersymbol.h
qgsplot.h
Generated on
for QGIS API Documentation by
1.17.0