25#include "moc_qgsplotregistry.cpp"
34 qDeleteAll( mMetadata );
39 if ( !mMetadata.isEmpty() )
51 return mMetadata.value( type );
56 if ( !metadata || mMetadata.contains( metadata->
type() ) )
59 mMetadata[metadata->
type()] = metadata;
66 if ( !mMetadata.contains( type ) )
70 delete mMetadata.take( type );
76 if ( !mMetadata.contains( type ) )
79 return mMetadata[type]->createPlot();
84 QMap<QString, QString> types;
85 for (
auto it = mMetadata.constBegin(); it != mMetadata.constEnd(); ++it )
87 types.insert( it.key(), it.value()->visibleName() );
static QgsVectorLayerAbstractPlotDataGatherer * createDataGatherer(QgsPlot *plot)
Returns a new data gatherer for a given bar chart plot.
static QgsBarChartPlot * create()
Returns a new bar chart.
static QgsVectorLayerAbstractPlotDataGatherer * createDataGatherer(QgsPlot *plot)
Returns a new data gatherer for a given line chart plot.
static QgsLineChartPlot * create()
Returns a new line chart.
static QgsPieChartPlot * create()
Returns a new pie chart.
static QgsVectorLayerAbstractPlotDataGatherer * createDataGatherer(QgsPlot *plot)
Returns a new data gatherer for a given pie chart plot.
QgsPlot * createPlot(const QString &type) const
Creates a new instance of a plot given the type.
QMap< QString, QString > plotTypes() const
Returns a map of available plot types to translated name.
bool removePlotType(const QString &type)
Removes a new a plot type from the registry.
QgsPlotRegistry(QObject *parent=nullptr)
Creates a new empty plot registry.
bool addPlotType(QgsPlotAbstractMetadata *metadata)
Registers a new plot type.
void plotAdded(const QString &type, const QString &name)
Emitted whenever a new plot type is added to the registry, with the specified type and visible name.
bool populate()
Populates the registry with standard plot types.
~QgsPlotRegistry() override
QgsPlotAbstractMetadata * plotMetadata(const QString &type) const
Returns the metadata for the specified plot type.
void plotAboutToBeRemoved(const QString &type)
Emitted whenever a plot type is about to be remove from the registry, with the specified type and vis...
Base class for plot/chart/graphs.