QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
QgsLineChartPlot Class Reference

A simple line chart class. More...

#include <qgslinechartplot.h>

Inheritance diagram for QgsLineChartPlot:

Public Member Functions

 QgsLineChartPlot ()
 ~QgsLineChartPlot () override=default
QgsLineSymbollineSymbolAt (int index) const
 Returns the line symbol for the series with matching index.
int lineSymbolCount () const
 Returns the line symbols list count.
QgsMarkerSymbolmarkerSymbolAt (int index) const
 Returns the marker symbol for the series with matching index.
int markerSymbolCount () const
 Returns the line symbols list count.
bool readXml (const QDomElement &element, const QgsReadWriteContext &context) override
 Reads the plot's properties from an XML element.
void renderContent (QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QRectF &plotArea, const QgsPlotData &plotData=QgsPlotData()) override
 Renders the plot content.
void setLineSymbolAt (int index, QgsLineSymbol *symbol)
 Sets the line symbol to use for the series with matching index.
void setMarkerSymbolAt (int index, QgsMarkerSymbol *symbol)
 Sets the fill symbol to use for the series with matching index.
QString type () const override
 Returns the plot's type.
bool writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override
 Writes the plot's properties into an XML element.
Public Member Functions inherited from Qgs2DXyPlot
 Qgs2DXyPlot ()
 Constructor for Qgs2DXyPlot.
 Qgs2DXyPlot (const Qgs2DXyPlot &other)=delete
 ~Qgs2DXyPlot () override
void calculateOptimisedIntervals (QgsRenderContext &context, QgsPlotRenderContext &plotContext)
 Automatically sets the grid and label intervals to optimal values for display in the given render context.
QgsFillSymbolchartBackgroundSymbol ()
 Returns the fill symbol used to render the background of the chart.
QgsFillSymbolchartBorderSymbol ()
 Returns the symbol used to render the border of the chart.
QRectF interiorPlotArea (QgsRenderContext &context, QgsPlotRenderContext &plotContext) const override
 Returns the area of the plot which corresponds to the actual plot content (excluding all titles and other components which sit outside the plot area).
Qgs2DXyPlotoperator= (const Qgs2DXyPlot &other)=delete
void render (QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QgsPlotData &plotData=QgsPlotData()) override
 Renders the plot.
void setChartBackgroundSymbol (QgsFillSymbol *symbol)
 Sets the fill symbol used to render the background of the chart.
void setChartBorderSymbol (QgsFillSymbol *symbol)
 Sets the symbol used to render the border of the chart.
void setXMaximum (double maximum)
 Sets the maximum value of the x axis.
void setXMinimum (double minimum)
 Sets the minimum value of the x axis.
void setYMaximum (double maximum)
 Sets the maximum value of the y axis.
void setYMinimum (double minimum)
 Sets the minimum value of the y axis.
QgsPlotAxisxAxis ()
 Returns a reference to the plot's x axis.
const QgsPlotAxisxAxis () const
 Returns a reference to the plot's x axis.
double xMaximum () const
 Returns the maximum value of the x axis.
double xMinimum () const
 Returns the minimum value of the x axis.
QgsPlotAxisyAxis ()
 Returns a reference to the plot's y axis.
const QgsPlotAxisyAxis () const
 Returns a reference to the plot's y axis.
double yMaximum () const
 Returns the maximum value of the y axis.
double yMinimum () const
 Returns the minimum value of the y axis.
Public Member Functions inherited from Qgs2DPlot
 Qgs2DPlot ()
 Constructor for Qgs2DPlot.
 Qgs2DPlot (const Qgs2DPlot &other)=delete
 ~Qgs2DPlot () override
const QgsMarginsmargins () const
 Returns the margins of the plot area (in millimeters).
Qgs2DPlotoperator= (const Qgs2DPlot &other)=delete
void setMargins (const QgsMargins &margins)
 Sets the margins of the plot area (in millimeters).
void setSize (QSizeF size)
 Sets the overall size of the plot (including titles and over components which sit outside the plot area).
QSizeF size () const
 Returns the overall size of the plot (in millimeters) (including titles and other components which sit outside the plot area).
Public Member Functions inherited from QgsPlot
 QgsPlot ()=default
virtual ~QgsPlot ()
QgsPropertyCollectiondataDefinedProperties ()
 Returns a reference to the plot's property collection, used for data defined overrides.
const QgsPropertyCollectiondataDefinedProperties () const
 Returns a reference to the plot's property collection, used for data defined overrides.
void setDataDefinedProperties (const QgsPropertyCollection &collection)
 Sets the plot's property collection, used for data defined overrides.
void setDataDefinedProperty (DataDefinedProperty key, const QgsProperty &property)
 Sets a data defined property for the plot.

Static Public Member Functions

static QgsLineChartPlotcreate ()
 Returns a new line chart.
static QgsVectorLayerAbstractPlotDataGatherercreateDataGatherer (QgsPlot *plot)
 Returns a new data gatherer for a given line chart plot.
Static Public Member Functions inherited from QgsPlot
static const QgsPropertiesDefinitionpropertyDefinitions ()
 Returns the plot property definitions.

Additional Inherited Members

Public Types inherited from QgsPlot
enum class  DataDefinedProperty : int {
  MarginLeft , MarginTop , MarginRight , MarginBottom ,
  XAxisMajorInterval , XAxisMinorInterval , XAxisLabelInterval , YAxisMajorInterval ,
  YAxisMinorInterval , YAxisLabelInterval , XAxisMinimum , XAxisMaximum ,
  YAxisMinimum , YAxisMaximum
}
 Data defined properties for different plot types. More...
Protected Member Functions inherited from Qgs2DXyPlot
void applyDataDefinedProperties (QgsRenderContext &context, double &minX, double &maxX, double &minY, double &maxY, double &majorIntervalX, double &minorIntervalX, double &labelIntervalX, double &majorIntervalY, double &minorIntervalY, double &labelIntervalY) const
 Applies 2D XY plot data-defined properties.
Protected Member Functions inherited from Qgs2DPlot
void applyDataDefinedProperties (QgsRenderContext &context, QgsMargins &margins) const
 Applies 2D plot data-defined properties.
Protected Attributes inherited from QgsPlot
QgsPropertyCollection mDataDefinedProperties

Detailed Description

A simple line chart class.

Warning
This class is not considered stable API, and may change in future!
Since
QGIS 4.0

Definition at line 37 of file qgslinechartplot.h.

Constructor & Destructor Documentation

◆ QgsLineChartPlot()

QgsLineChartPlot::QgsLineChartPlot ( )

Definition at line 26 of file qgslinechartplot.cpp.

◆ ~QgsLineChartPlot()

QgsLineChartPlot::~QgsLineChartPlot ( )
overridedefault

Member Function Documentation

◆ create()

QgsLineChartPlot * QgsLineChartPlot::create ( )
static

Returns a new line chart.

Definition at line 340 of file qgslinechartplot.cpp.

◆ createDataGatherer()

QgsVectorLayerAbstractPlotDataGatherer * QgsLineChartPlot::createDataGatherer ( QgsPlot * plot)
static

Returns a new data gatherer for a given line chart plot.

Definition at line 345 of file qgslinechartplot.cpp.

◆ lineSymbolAt()

QgsLineSymbol * QgsLineChartPlot::lineSymbolAt ( int index) const

Returns the line symbol for the series with matching index.

Definition at line 237 of file qgslinechartplot.cpp.

◆ lineSymbolCount()

int QgsLineChartPlot::lineSymbolCount ( ) const
inline

Returns the line symbols list count.

Definition at line 79 of file qgslinechartplot.h.

◆ markerSymbolAt()

QgsMarkerSymbol * QgsLineChartPlot::markerSymbolAt ( int index) const

Returns the marker symbol for the series with matching index.

Definition at line 212 of file qgslinechartplot.cpp.

◆ markerSymbolCount()

int QgsLineChartPlot::markerSymbolCount ( ) const
inline

Returns the line symbols list count.

Definition at line 64 of file qgslinechartplot.h.

◆ readXml()

bool QgsLineChartPlot::readXml ( const QDomElement & element,
const QgsReadWriteContext & context )
overridevirtual

Reads the plot's properties from an XML element.

Reimplemented from Qgs2DXyPlot.

Definition at line 295 of file qgslinechartplot.cpp.

◆ renderContent()

void QgsLineChartPlot::renderContent ( QgsRenderContext & context,
QgsPlotRenderContext & plotContext,
const QRectF & plotArea,
const QgsPlotData & plotData = QgsPlotData() )
overridevirtual

Renders the plot content.

Subclasses can implement this method to render the actual plot content (e.g. bar charts, scatter plots). This method will be called after the chart background and grid are rendered, but before the chart border is rendered.

The default implementation does nothing.

The plotArea argument specifies that area of the plot which corresponds to the actual plot content. Implementations should take care to scale values accordingly to render points correctly inside this plot area.

Reimplemented from Qgs2DPlot.

Definition at line 32 of file qgslinechartplot.cpp.

◆ setLineSymbolAt()

void QgsLineChartPlot::setLineSymbolAt ( int index,
QgsLineSymbol * symbol )

Sets the line symbol to use for the series with matching index.

Definition at line 247 of file qgslinechartplot.cpp.

◆ setMarkerSymbolAt()

void QgsLineChartPlot::setMarkerSymbolAt ( int index,
QgsMarkerSymbol * symbol )

Sets the fill symbol to use for the series with matching index.

Definition at line 222 of file qgslinechartplot.cpp.

◆ type()

QString QgsLineChartPlot::type ( ) const
inlineoverridevirtual

Returns the plot's type.

Since
QGIS 4.0

Reimplemented from QgsPlot.

Definition at line 44 of file qgslinechartplot.h.

◆ writeXml()

bool QgsLineChartPlot::writeXml ( QDomElement & element,
QDomDocument & document,
const QgsReadWriteContext & context ) const
overridevirtual

Writes the plot's properties into an XML element.

Reimplemented from Qgs2DXyPlot.

Definition at line 262 of file qgslinechartplot.cpp.


The documentation for this class was generated from the following files: