11 #ifndef KDCHARTLEGEND_H
12 #define KDCHARTLEGEND_H
22 class AbstractDiagram;
51 explicit Legend(QWidget *parent =
nullptr);
62 void setLegendStyle(LegendStyle style);
63 LegendStyle legendStyle()
const;
65 virtual Legend *clone()
const;
70 bool compare(
const Legend *other)
const;
72 void resizeEvent(QResizeEvent *event)
override;
74 void paint(QPainter *painter)
override;
75 void setVisible(
bool visible)
override;
92 void setReferenceArea(
const QWidget *area);
100 const QWidget *referenceArea()
const;
143 void removeDiagrams();
186 void setPosition(
Position position);
202 void setAlignment(Qt::Alignment);
208 Qt::Alignment alignment()
const;
215 void setTextAlignment(Qt::Alignment);
222 Qt::Alignment textAlignment()
const;
230 void setLegendSymbolAlignment(Qt::Alignment);
238 Qt::Alignment legendSymbolAlignment()
const;
292 void setOrientation(Qt::Orientation orientation);
293 Qt::Orientation orientation()
const;
295 void setSortOrder(Qt::SortOrder order);
296 Qt::SortOrder sortOrder()
const;
298 void setShowLines(
bool legendShowLines);
299 bool showLines()
const;
302 void setText(uint dataset,
const QString &text);
303 QString text(uint dataset)
const;
313 void setHiddenDatasets(
const QList<uint> &hiddenDatasets);
314 const QList<uint> hiddenDatasets()
const;
315 void setDatasetHidden(uint dataset,
bool hidden);
316 bool datasetIsHidden(uint dataset)
const;
318 uint datasetCount()
const;
320 void setDefaultColors();
321 void setRainbowColors();
322 void setSubduedColors(
bool ordered =
false);
331 void setColor(uint dataset,
const QColor &color);
333 void setBrush(uint dataset,
const QBrush &brush);
334 QBrush brush(uint dataset)
const;
337 void setPen(uint dataset,
const QPen &pen);
338 QPen pen(uint dataset)
const;
357 void setUseAutomaticMarkerSize(
bool useAutomaticMarkerSize);
358 bool useAutomaticMarkerSize()
const;
363 void setTitleText(
const QString &text);
364 QString titleText()
const;
369 void setSpacing(uint space);
370 uint spacing()
const;
373 void forceRebuild()
override;
375 QSize minimumSizeHint()
const override;
376 QSize sizeHint()
const override;
377 bool hasHeightForWidth()
const override;
378 int heightForWidth(
int width)
const override;
379 void needSizeHint()
override;
380 void resizeLayout(
const QSize &size)
override;
388 void emitPositionChanged();
390 void activateTheLayout();
391 void setNeedRebuild();
#define KDCHART_DECLARE_PRIVATE_DERIVED_QWIDGET(X)
AbstractDiagram defines the interface for diagram classes.
Legend defines the interface for the legend drawing class.
void destroyedLegend(Legend *)
A set of attributes controlling the appearance of data set markers.
Defines a position, using compass terminology.
Defines relative position information: reference area, position in this area (reference position),...
A set of text attributes.
QList< const AbstractDiagram * > ConstDiagramList
QList< AbstractDiagram * > DiagramList