59 sipType = sipType_QgsBarChartPlot;
63 sipType = sipType_QgsLineChartPlot;
67 sipType = sipType_QgsPieChartPlot;
69 else if (
dynamic_cast<Qgs2DXyPlot *
>( item ) != NULL )
71 sipType = sipType_Qgs2DXyPlot;
73 else if (
dynamic_cast<Qgs2DPlot *
>( item ) != NULL )
75 sipType = sipType_Qgs2DPlot;
79 sipType = sipType_QgsPlot;
121 virtual QString
type()
const {
return QString(); }
156 virtual bool writeXml( QDomElement &element, QDomDocument &document,
const QgsReadWriteContext &context )
const;
172 static void initPropertyDefinitions();
211 sipType = sipType_QgsXyPlotSeries;
215 sipType = sipType_QgsAbstractPlotSeries;
232 QString
name()
const;
267 QList<std::pair<double, double>>
data()
const;
272 void setData(
const QList<std::pair<double, double>> &
data );
277 void append(
double x,
double y );
288 QList<std::pair<
double,
double>> mData;
315 QList<QgsAbstractPlotSeries *>
series()
const;
340 QList<QgsAbstractPlotSeries *> mSeries;
341 QStringList mCategories;
496 QString labelSuffix()
const;
506 void setLabelSuffix(
const QString &suffix );
536 double mGridIntervalMinor = 1;
537 double mGridIntervalMajor = 5;
539 double mLabelInterval = 1;
541 QString mLabelSuffix;
544 std::unique_ptr< QgsNumericFormat > mNumericFormat;
546 std::unique_ptr< QgsLineSymbol > mGridMajorSymbol;
547 std::unique_ptr< QgsLineSymbol > mGridMinorSymbol;
814 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;
827 std::unique_ptr< QgsFillSymbol > mChartBackgroundSymbol;
828 std::unique_ptr< QgsFillSymbol > mChartBorderSymbol;
PlotAxisSuffixPlacement
Placement options for suffixes in the labels for axis of plots.
@ EveryLabel
Place suffix after every value label.
PlotAxisType
Plots axis types.
@ Interval
The axis represents a range of values.
Base class for 2-dimensional plot/chart/graphs.
bool writeXml(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override
Writes the plot's properties into an XML element.
void applyDataDefinedProperties(QgsRenderContext &context, QgsMargins &margins) const
Applies 2D plot data-defined properties.
virtual void renderContent(QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QRectF &plotArea, const QgsPlotData &plotData=QgsPlotData())
Renders the plot content.
void setSize(QSizeF size)
Sets the overall size of the plot (including titles and over components which sit outside the plot ar...
const QgsMargins & margins() const
Returns the margins of the plot area (in millimeters).
Qgs2DPlot & operator=(const Qgs2DPlot &other)=delete
virtual QRectF interiorPlotArea(QgsRenderContext &context, QgsPlotRenderContext &plotContext) const
Returns the area of the plot which corresponds to the actual plot content (excluding all titles and o...
Qgs2DPlot()
Constructor for Qgs2DPlot.
Qgs2DPlot(const Qgs2DPlot &other)=delete
bool readXml(const QDomElement &element, const QgsReadWriteContext &context) override
Reads the plot's properties from an XML element.
virtual void render(QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QgsPlotData &plotData=QgsPlotData())
Renders the plot.
QSizeF size() const
Returns the overall size of the plot (in millimeters) (including titles and other components which si...
void setMargins(const QgsMargins &margins)
Sets the margins of the plot area (in millimeters).
Base class for 2-dimensional plot/chart/graphs with an X and Y axes.
void setXMaximum(double maximum)
Sets the maximum value of the x axis.
double yMaximum() const
Returns the maximum value of the y axis.
void setYMinimum(double minimum)
Sets the minimum value of the y axis.
double xMinimum() const
Returns the minimum value of the x axis.
bool readXml(const QDomElement &element, const QgsReadWriteContext &context) override
Reads the plot's properties from an XML element.
Qgs2DXyPlot(const Qgs2DXyPlot &other)=delete
Qgs2DXyPlot & operator=(const Qgs2DXyPlot &other)=delete
QgsPlotAxis & yAxis()
Returns a reference to the plot's y axis.
void render(QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QgsPlotData &plotData=QgsPlotData()) override
Renders the plot.
void setXMinimum(double minimum)
Sets the minimum value of the x axis.
void calculateOptimisedIntervals(QgsRenderContext &context, QgsPlotRenderContext &plotContext)
Automatically sets the grid and label intervals to optimal values for display in the given render con...
const QgsPlotAxis & yAxis() const
Returns a reference to the plot's y axis.
QgsPlotAxis & xAxis()
Returns a reference to the plot's x axis.
Qgs2DXyPlot()
Constructor for Qgs2DXyPlot.
const QgsPlotAxis & xAxis() const
Returns a reference to the plot's x axis.
double yMinimum() const
Returns the minimum value of the y axis.
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 o...
void setYMaximum(double maximum)
Sets the maximum value of the y axis.
bool writeXml(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override
Writes the plot's properties into an XML element.
double xMaximum() const
Returns the maximum value of the x axis.
An abstract class used to encapsulate the data for a plot series.
void setName(const QString &name)
Sets the series' name.
virtual ~QgsAbstractPlotSeries()=default
QString name() const
Returns the series' name.
QgsAbstractPlotSeries()=default
virtual QgsAbstractPlotSeries * clone() const =0
Clones the series.
A simple bar chart class.
Abstract base class for color ramps.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A simple line chart class.
A line symbol type, for rendering LineString and MultiLineString geometries.
Defines the four margins of a rectangle.
A marker symbol type, for rendering Point and MultiPoint geometries.
A simple pie chart class.
Encapsulates the properties of a plot axis.
bool readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads the axis' properties from an XML element.
double gridIntervalMinor() const
Returns the interval of minor grid lines for the axis.
double gridIntervalMajor() const
Returns the interval of major grid lines for the axis.
void setType(Qgis::PlotAxisType type)
Sets the axis type.
void setGridIntervalMajor(double interval)
Sets the interval of major grid lines for the axis.
void setGridIntervalMinor(double interval)
Sets the interval of minor grid lines for the axis.
void setLabelInterval(double interval)
Sets the interval of labels for the axis.
Qgis::PlotAxisType type() const
Returns the axis type.
double labelInterval() const
Returns the interval of labels for the axis.
QgsPlotAxis & operator=(const QgsPlotAxis &other)=delete
bool writeXml(QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
Writes the axis' properties into an XML element.
QgsPlotAxis(const QgsPlotAxis &other)=delete
Encapsulates one or more plot series.
QStringList categories() const
Returns the name of the series' categories.
QgsPlotData & operator=(const QgsPlotData &other)
void clearSeries()
Clears all series from the plot data.
QList< QgsAbstractPlotSeries * > series() const
Returns the list of series forming the plot data.
void setCategories(const QStringList &categories)
Sets the name of the series' categories.
void addSeries(QgsAbstractPlotSeries *series)
Adds a series to the plot data.
Manages default settings for plot objects.
static QgsFillSymbol * chartBorderSymbol()
Returns the default fill symbol to use for the chart area border.
static QgsNumericFormat * pieChartNumericFormat()
Returns the default color ramp to use for pie charts.
static QgsNumericFormat * axisLabelNumericFormat()
Returns the default numeric format to use for plot axis labels.
static QgsColorRamp * pieChartColorRamp()
Returns the default color ramp to use for pie charts.
static QgsFillSymbol * barChartFillSymbol()
Returns the default fill symbol to use for bar charts.
static QgsLineSymbol * lineChartLineSymbol()
Returns the default line symbol to use for line charts.
static QgsLineSymbol * axisGridMinorSymbol()
Returns the default line symbol to use for axis minor grid lines.
static QgsFillSymbol * pieChartFillSymbol()
Returns the default fill symbol to use for pie charts.
static QgsMarkerSymbol * lineChartMarkerSymbol()
Returns the default marker symbol to use for line charts.
static QgsFillSymbol * chartBackgroundSymbol()
Returns the default fill symbol to use for the chart area background fill.
static QgsLineSymbol * axisGridMajorSymbol()
Returns the default line symbol to use for axis major grid lines.
Contains information about the context of a plot rendering operation.
~QgsPlotRenderContext()=default
QgsPlotRenderContext()=default
Constructor for QgsPlotRenderContext.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the plot's property collection, used for data defined overrides.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the plot's property collection, used for data defined overrides.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the plot's property collection, used for data defined overrides.
virtual QString type() const
Returns the plot's type.
QgsPropertyCollection mDataDefinedProperties
void setDataDefinedProperty(DataDefinedProperty key, const QgsProperty &property)
Sets a data defined property for the plot.
DataDefinedProperty
Data defined properties for different plot types.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A store for object properties.
A container for the context for various read/write operations on objects.
Contains information about the context of a rendering operation.
Abstract base class for all rendered symbols.
Container for all settings relating to text rendering.
Encapsulates the data for an XY plot series.
void setData(const QList< std::pair< double, double > > &data)
Sets the series' list of XY pairs of double.
QgsAbstractPlotSeries * clone() const override
Clones the series.
QgsXyPlotSeries()=default
void append(double x, double y)
Appends a pair of X/Y double values to the series.
void clear()
Clears the series' data.
QList< std::pair< double, double > > data() const
Returns the series' list of XY pairs of double.
~QgsXyPlotSeries() override=default
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.