KD Chart API Documentation  3.1
Public Types | Signals | Public Member Functions | List of all members
KDChart::Legend Class Reference

Legend defines the interface for the legend drawing class. More...

#include <KDChartLegend.h>

Inheritance diagram for KDChart::Legend:
KDChart::AbstractAreaWidget KDChart::AbstractAreaBase

Public Types

enum  LegendStyle { MarkersOnly = 0 , LinesOnly = 1 , MarkersAndLines = 2 }
 

Signals

void destroyedLegend (Legend *)
 
void propertiesChanged ()
 
- Signals inherited from KDChart::AbstractAreaWidget
void positionChanged (AbstractAreaWidget *)
 

Public Member Functions

 Legend (KDChart::AbstractDiagram *diagram, QWidget *parent=nullptr)
 
 Legend (QWidget *parent=nullptr)
 
 ~Legend () override
 
void addDiagram (KDChart::AbstractDiagram *newDiagram)
 
Qt::Alignment alignment () const
 
QBrush brush (uint dataset) const
 
const QMap< uint, QBrush > brushes () const
 
virtual Legendclone () const
 
bool compare (const Legend *other) const
 
ConstDiagramList constDiagrams () const
 
uint datasetCount () const
 
bool datasetIsHidden (uint dataset) const
 
uint dataSetOffset (KDChart::AbstractDiagram *diagram)
 
KDChart::AbstractDiagramdiagram () const
 
DiagramList diagrams () const
 
const RelativePosition floatingPosition () const
 
void forceRebuild () override
 
bool hasHeightForWidth () const override
 
int heightForWidth (int width) const override
 
const QList< uint > hiddenDatasets () const
 
LegendStyle legendStyle () const
 
Qt::Alignment legendSymbolAlignment () const
 Returns the alignment used while drawing legend symbol(alignment of Legend::LinesOnly) within the legend. More...
 
const QMap< uint, MarkerAttributesmarkerAttributes () const
 
MarkerAttributes markerAttributes (uint dataset) const
 
QSize minimumSizeHint () const override
 
void needSizeHint () override
 
Qt::Orientation orientation () const
 
void paint (QPainter *painter) override
 
QPen pen (uint dataset) const
 
const QMap< uint, QPen > pens () const
 
Position position () const
 
const QWidget * referenceArea () const
 
void removeDiagram (KDChart::AbstractDiagram *oldDiagram)
 
void removeDiagrams ()
 
void replaceDiagram (KDChart::AbstractDiagram *newDiagram, KDChart::AbstractDiagram *oldDiagram=nullptr)
 
void resetTexts ()
 Removes all legend texts that might have been set by setText. More...
 
void resizeEvent (QResizeEvent *event) override
 
void resizeLayout (const QSize &size) override
 
void setAlignment (Qt::Alignment)
 Specify the alignment of a non-floating legend. More...
 
void setBrush (uint dataset, const QBrush &brush)
 
void setBrushesFromDiagram (KDChart::AbstractDiagram *diagram)
 
void setColor (uint dataset, const QColor &color)
 
void setDatasetHidden (uint dataset, bool hidden)
 
void setDefaultColors ()
 
void setDiagram (KDChart::AbstractDiagram *newDiagram)
 A convenience method doing the same as replaceDiagram( newDiagram, 0 );. More...
 
void setFloatingPosition (const RelativePosition &relativePosition)
 
void setHiddenDatasets (const QList< uint > &hiddenDatasets)
 
void setLegendStyle (LegendStyle style)
 
void setLegendSymbolAlignment (Qt::Alignment)
 Specify the alignment of the legend symbol( alignment of Legend::LinesOnly) within the legend. More...
 
void setMarkerAttributes (uint dataset, const MarkerAttributes &)
 
void setOrientation (Qt::Orientation orientation)
 
void setPen (uint dataset, const QPen &pen)
 
void setPosition (Position position)
 Specify the position of a non-floating legend. More...
 
void setRainbowColors ()
 
void setReferenceArea (const QWidget *area)
 
void setShowLines (bool legendShowLines)
 
void setSortOrder (Qt::SortOrder order)
 
void setSpacing (uint space)
 
void setSubduedColors (bool ordered=false)
 
void setText (uint dataset, const QString &text)
 
void setTextAlignment (Qt::Alignment)
 Specify the alignment of the text elements within the legend. More...
 
void setTextAttributes (const TextAttributes &a)
 
void setTitleText (const QString &text)
 
void setTitleTextAttributes (const TextAttributes &a)
 
void setUseAutomaticMarkerSize (bool useAutomaticMarkerSize)
 
void setVisible (bool visible) override
 
bool showLines () const
 
QSize sizeHint () const override
 
Qt::SortOrder sortOrder () const
 
uint spacing () const
 
QString text (uint dataset) const
 
Qt::Alignment textAlignment () const
 Returns the alignment used while rendering text elements within the legend. More...
 
TextAttributes textAttributes () const
 
const QMap< uint, QString > texts () const
 
QString titleText () const
 
TextAttributes titleTextAttributes () const
 
bool useAutomaticMarkerSize () const
 
- Public Member Functions inherited from KDChart::AbstractAreaWidget
 AbstractAreaWidget (QWidget *parent=nullptr)
 
void paintAll (QPainter &painter)
 
void paintEvent (QPaintEvent *event) override
 Draws the background and frame, then calls paint(). More...
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint(). More...
 
- Public Member Functions inherited from KDChart::AbstractAreaBase
void alignToReferencePoint (const RelativePosition &position)
 
BackgroundAttributes backgroundAttributes () const
 
bool compare (const AbstractAreaBase *other) const
 
FrameAttributes frameAttributes () const
 
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
 
virtual void paintBackground (QPainter &painter, const QRect &rectangle)
 
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
 
void setBackgroundAttributes (const BackgroundAttributes &a)
 
void setFrameAttributes (const FrameAttributes &a)
 

Additional Inherited Members

- Static Public Member Functions inherited from KDChart::AbstractAreaBase
static void paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KDChart::BackgroundAttributes &attributes)
 
static void paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KDChart::FrameAttributes &attributes)
 
- Protected Member Functions inherited from KDChart::AbstractAreaWidget
 ~AbstractAreaWidget () override
 
QRect areaGeometry () const override
 
void positionHasChanged () override
 
- Protected Member Functions inherited from KDChart::AbstractAreaBase
 AbstractAreaBase ()
 
virtual ~AbstractAreaBase ()
 
QRect innerRect () const
 

Detailed Description

Legend defines the interface for the legend drawing class.

Legend is the class for drawing legends for all kinds of diagrams ("chart types").

Legend is drawn on chart level, not per diagram, but you can have more than one legend per chart, using KDChart::Chart::addLegend().

Note
Legend is different from all other classes ofd KD Chart, since it can be displayed outside of the Chart's area. If you want to, you can embed the legend into your own widget, or into another part of a bigger layout, into which you might have inserted the Chart.

On the other hand, please note that you MUST call Chart::addLegend to get your legend positioned into the correct place of your chart - if you want to have the legend shown inside of the chart (that's probably true for most cases).

Definition at line 43 of file KDChartLegend.h.

Member Enumeration Documentation

◆ LegendStyle

Enumerator
MarkersOnly 
LinesOnly 
MarkersAndLines 

Definition at line 55 of file KDChartLegend.h.

Constructor & Destructor Documentation

◆ Legend() [1/2]

Legend::Legend ( QWidget *  parent = nullptr)
explicit

Definition at line 60 of file KDChartLegend.cpp.

References d.

Referenced by clone().

◆ Legend() [2/2]

Legend::Legend ( KDChart::AbstractDiagram diagram,
QWidget *  parent = nullptr 
)
explicit

Definition at line 67 of file KDChartLegend.cpp.

References d, diagram(), and setDiagram().

◆ ~Legend()

Legend::~Legend ( )
override

Definition at line 75 of file KDChartLegend.cpp.

References destroyedLegend().

Member Function Documentation

◆ addDiagram()

void Legend::addDiagram ( KDChart::AbstractDiagram newDiagram)

◆ alignment()

Qt::Alignment Legend::alignment ( ) const

Returns the alignment of a non-floating legend.

See also
setAlignment

Definition at line 428 of file KDChartLegend.cpp.

References d.

Referenced by clone(), compare(), setAlignment(), setLegendSymbolAlignment(), and setTextAlignment().

◆ brush()

QBrush Legend::brush ( uint  dataset) const

Definition at line 587 of file KDChartLegend.cpp.

References d.

Referenced by setBrush().

◆ brushes()

const QMap< uint, QBrush > Legend::brushes ( ) const

Definition at line 596 of file KDChartLegend.cpp.

References d.

Referenced by compare().

◆ clone()

Legend * Legend::clone ( ) const
virtual

◆ compare()

bool Legend::compare ( const Legend other) const

◆ constDiagrams()

ConstDiagramList Legend::constDiagrams ( ) const
Returns
The list of diagrams associated with this legend.

Definition at line 266 of file KDChartLegend.cpp.

References d.

◆ datasetCount()

uint Legend::datasetCount ( ) const

◆ datasetIsHidden()

bool Legend::datasetIsHidden ( uint  dataset) const

Definition at line 1194 of file KDChartLegend.cpp.

References d.

◆ dataSetOffset()

uint Legend::dataSetOffset ( KDChart::AbstractDiagram diagram)

Returns the offset of the first dataset of diagram.

Definition at line 357 of file KDChartLegend.cpp.

References d, and diagram().

◆ destroyedLegend

void KDChart::Legend::destroyedLegend ( Legend )
signal

Referenced by ~Legend().

◆ diagram()

AbstractDiagram * Legend::diagram ( ) const

The first diagram of the legend or 0 if there was none added to the legend.

Returns
The first diagram of the legend or 0.
See also
diagrams, addDiagram, removeDiagram, removeDiagrams, replaceDiagram, setDiagram

Definition at line 249 of file KDChartLegend.cpp.

References d.

Referenced by Legend(), datasetCount(), dataSetOffset(), paint(), and setBrushesFromDiagram().

◆ diagrams()

DiagramList Legend::diagrams ( ) const

The list of all diagrams associated with the legend.

Returns
The list of all diagrams associated with the legend.
See also
diagram, addDiagram, removeDiagram, removeDiagrams, replaceDiagram, setDiagram

Definition at line 257 of file KDChartLegend.cpp.

References d.

Referenced by removeDiagram(), and removeDiagrams().

◆ floatingPosition()

const RelativePosition Legend::floatingPosition ( ) const

Returns the position of a floating legend.

See also
setFloatingPosition

Definition at line 470 of file KDChartLegend.cpp.

References d.

Referenced by compare(), and KDChart::Chart::reLayoutFloatingLegends().

◆ forceRebuild()

void Legend::forceRebuild ( )
overridevirtual

Call this to trigger an unconditional re-building of the widget's internals.

Reimplemented from KDChart::AbstractAreaWidget.

Definition at line 709 of file KDChartLegend.cpp.

Referenced by resizeEvent().

◆ hasHeightForWidth()

bool Legend::hasHeightForWidth ( ) const
override

Definition at line 1112 of file KDChartLegend.cpp.

References d.

◆ heightForWidth()

int Legend::heightForWidth ( int  width) const
override

Definition at line 1120 of file KDChartLegend.cpp.

References d, showLines(), and spacing().

◆ hiddenDatasets()

const QList< uint > Legend::hiddenDatasets ( ) const

Definition at line 1180 of file KDChartLegend.cpp.

References d.

Referenced by setHiddenDatasets().

◆ legendStyle()

Legend::LegendStyle Legend::legendStyle ( ) const

Definition at line 170 of file KDChartLegend.cpp.

References d.

Referenced by clone(), and compare().

◆ legendSymbolAlignment()

Qt::Alignment Legend::legendSymbolAlignment ( ) const

Returns the alignment used while drawing legend symbol(alignment of Legend::LinesOnly) within the legend.

See also
setLegendSymbolAlignment()

Definition at line 456 of file KDChartLegend.cpp.

References d.

◆ markerAttributes() [1/2]

const QMap< uint, MarkerAttributes > Legend::markerAttributes ( ) const

Definition at line 662 of file KDChartLegend.cpp.

References d.

Referenced by compare(), and setMarkerAttributes().

◆ markerAttributes() [2/2]

MarkerAttributes Legend::markerAttributes ( uint  dataset) const

Definition at line 651 of file KDChartLegend.cpp.

References d.

Referenced by compare().

◆ minimumSizeHint()

QSize Legend::minimumSizeHint ( ) const
override

Definition at line 116 of file KDChartLegend.cpp.

References sizeHint().

◆ needSizeHint()

void Legend::needSizeHint ( )
overridevirtual

Call this to trigger an conditional re-building of the widget's internals.

e.g. AbstractAreaWidget call this, before calling layout()->setGeometry()

Reimplemented from KDChart::AbstractAreaWidget.

Definition at line 134 of file KDChartLegend.cpp.

◆ orientation()

Qt::Orientation Legend::orientation ( ) const

Definition at line 485 of file KDChartLegend.cpp.

References d.

Referenced by compare(), and setOrientation().

◆ paint()

void Legend::paint ( QPainter *  painter)
overridevirtual

Overwrite this to paint the inner contents of your widget.

Note
When overriding this method, please let your widget draw itself at the top/left corner of the painter. You should call rect() (or width(), height(), resp.) to find the drawable area's size: While the paint() method is being executed the frame of the widget is outside of its rect(), so you can use all of rect() for your custom drawing!
See also
paint, paintIntoRect

Implements KDChart::AbstractAreaWidget.

Definition at line 204 of file KDChartLegend.cpp.

References d, and diagram().

◆ pen()

QPen Legend::pen ( uint  dataset) const

Definition at line 627 of file KDChartLegend.cpp.

References d.

Referenced by setPen().

◆ pens()

const QMap< uint, QPen > Legend::pens ( ) const

Definition at line 636 of file KDChartLegend.cpp.

References d.

Referenced by compare().

◆ position()

Position Legend::position ( ) const

Returns the position of a non-floating legend.

See also
setPosition

Definition at line 414 of file KDChartLegend.cpp.

References d.

Referenced by clone(), compare(), KDChart::Chart::reLayoutFloatingLegends(), and setPosition().

◆ propertiesChanged

void KDChart::Legend::propertiesChanged ( )
signal

Emitted upon change of a property of the Legend or any of its components.

◆ referenceArea()

const QWidget * Legend::referenceArea ( ) const

Returns the reference area, that is used for font size of title text, and for font size of the item texts, IF automatic area detection is set.

See also
setReferenceArea

Definition at line 244 of file KDChartLegend.cpp.

References d.

◆ removeDiagram()

void Legend::removeDiagram ( KDChart::AbstractDiagram oldDiagram)

Removes the diagram from the legend's list of diagrams.

See also
diagram, diagrams, addDiagram, removeDiagrams, replaceDiagram, setDiagram

Definition at line 295 of file KDChartLegend.cpp.

References d, KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetPens(), and diagrams().

Referenced by removeDiagrams(), and replaceDiagram().

◆ removeDiagrams()

void Legend::removeDiagrams ( )

Removes all diagrams from the legend's list of diagrams.

See also
diagram, diagrams, addDiagram, removeDiagram, replaceDiagram, setDiagram

Definition at line 326 of file KDChartLegend.cpp.

References d, diagrams(), and removeDiagram().

◆ replaceDiagram()

void Legend::replaceDiagram ( KDChart::AbstractDiagram newDiagram,
KDChart::AbstractDiagram oldDiagram = nullptr 
)

Replaces the old diagram, or appends the new diagram, it there is none yet.

Parameters
newDiagramThe diagram to be used instead of the old one. If this parameter is zero, the first diagram will just be removed.
oldDiagramThe diagram to be removed by the new one. This diagram will be deleted automatically. If the parameter is omitted, the very first diagram will be replaced. In case, there was no diagram yet, the new diagram will just be added.
See also
diagram, diagrams, addDiagram, removeDiagram, removeDiagrams, setDiagram

Definition at line 339 of file KDChartLegend.cpp.

References addDiagram(), d, and removeDiagram().

Referenced by setDiagram().

◆ resetTexts()

void Legend::resetTexts ( )

Removes all legend texts that might have been set by setText.

This resets the Legend to default behaviour: Texts are created automatically.

Definition at line 537 of file KDChartLegend.cpp.

References d.

◆ resizeEvent()

void Legend::resizeEvent ( QResizeEvent *  event)
override

Definition at line 770 of file KDChartLegend.cpp.

References forceRebuild(), and sizeHint().

◆ resizeLayout()

void Legend::resizeLayout ( const QSize &  size)
overridevirtual

Reimplemented from KDChart::AbstractAreaWidget.

Definition at line 139 of file KDChartLegend.cpp.

References d.

◆ setAlignment()

void Legend::setAlignment ( Qt::Alignment  alignment)

Specify the alignment of a non-floating legend.

Use setFloatingPosition to set position and alignment if your legend is floating.

See also
alignment, setPosition, setFloatingPosition

Definition at line 419 of file KDChartLegend.cpp.

References alignment(), and d.

◆ setBrush()

void Legend::setBrush ( uint  dataset,
const QBrush &  brush 
)

Definition at line 578 of file KDChartLegend.cpp.

References brush(), and d.

Referenced by setDefaultColors(), setRainbowColors(), and setSubduedColors().

◆ setBrushesFromDiagram()

void Legend::setBrushesFromDiagram ( KDChart::AbstractDiagram diagram)

Definition at line 601 of file KDChartLegend.cpp.

References d, KDChart::AbstractDiagram::datasetBrushes(), and diagram().

◆ setColor()

void Legend::setColor ( uint  dataset,
const QColor &  color 
)

Note: there is no color() getter method, since setColor just sets a QBrush with the respective color, so the brush() getter method is sufficient.

Definition at line 569 of file KDChartLegend.cpp.

References d.

◆ setDatasetHidden()

void Legend::setDatasetHidden ( uint  dataset,
bool  hidden 
)

Definition at line 1185 of file KDChartLegend.cpp.

References d.

◆ setDefaultColors()

void Legend::setDefaultColors ( )

◆ setDiagram()

void Legend::setDiagram ( KDChart::AbstractDiagram newDiagram)

A convenience method doing the same as replaceDiagram( newDiagram, 0 );.

Replaces the first diagram by the given diagram. If the legend's list of diagram is empty the given diagram is added to the list.

See also
diagram, diagrams, addDiagram, removeDiagram, removeDiagrams, replaceDiagram

Definition at line 375 of file KDChartLegend.cpp.

References replaceDiagram().

Referenced by Legend(), KDChart::Widget::addLegend(), and KDChart::Widget::replaceLegend().

◆ setFloatingPosition()

void Legend::setFloatingPosition ( const RelativePosition relativePosition)
   \brief Specify the position and alignment of a floating legend.

   Use setPosition and setAlignment to set position and alignment
   if your legend is non-floating.

   \note When setFloatingPosition is called, the Legend's position value is set to
   KDChart::Position::Floating automatically.

   If your Chart is pointed to by m_chart, your could have the floating legend
   aligned exactly to the chart's coordinate plane's top-right corner
   with the following commands:
KDChart::RelativePosition relativePosition;
relativePosition.setReferenceArea( m_chart->coordinatePlane() );
relativePosition.setReferencePosition( Position::NorthEast );
relativePosition.setAlignment( Qt::AlignTop | Qt::AlignRight );
relativePosition.setHorizontalPadding(
    KDChart::Measure( -1.0, KDChartEnums::MeasureCalculationModeAbsolute ) );
relativePosition.setVerticalPadding(
    KDChart::Measure( 0.0, KDChartEnums::MeasureCalculationModeAbsolute ) );
m_legend->setFloatingPosition( relativePosition );
   To have the legend positioned at a fixed point, measured from the QPainter's top left corner,
   you could use the following code code:
KDChart::RelativePosition relativePosition;
relativePosition.setReferencePoints( PositionPoints( QPointF( 0.0, 0.0 ) ) );
relativePosition.setReferencePosition( Position::NorthWest );
relativePosition.setAlignment( Qt::AlignTop | Qt::AlignLeft );
relativePosition.setHorizontalPadding(
    KDChart::Measure( 4.0, KDChartEnums::MeasureCalculationModeAbsolute ) );
relativePosition.setVerticalPadding(
    KDChart::Measure( 4.0, KDChartEnums::MeasureCalculationModeAbsolute ) );
m_legend->setFloatingPosition( relativePosition );

Actually that's exactly the code KD Chart is using as default position for any floating legends, so if you just say setPosition( KDChart::Position::Floating ) without calling setFloatingPosition your legend will be positioned at point 4/4.

See also
setPosition, setAlignment

Definition at line 461 of file KDChartLegend.cpp.

References d, and KDChart::Position::Floating.

◆ setHiddenDatasets()

void Legend::setHiddenDatasets ( const QList< uint > &  hiddenDatasets)

Sets a list of datasets that are to be hidden in the legend.

By passing an empty list, you show all datasets. All datasets are shown by default, which means that hiddenDatasets() returns an empty list.

Definition at line 1175 of file KDChartLegend.cpp.

References d, and hiddenDatasets().

◆ setLegendStyle()

void Legend::setLegendStyle ( LegendStyle  style)

Definition at line 161 of file KDChartLegend.cpp.

References d.

◆ setLegendSymbolAlignment()

void Legend::setLegendSymbolAlignment ( Qt::Alignment  alignment)

Specify the alignment of the legend symbol( alignment of Legend::LinesOnly) within the legend.

See also
legendSymbolAlignment()

Definition at line 447 of file KDChartLegend.cpp.

References alignment(), and d.

◆ setMarkerAttributes()

void Legend::setMarkerAttributes ( uint  dataset,
const MarkerAttributes markerAttributes 
)

Note that any sizes specified via setMarkerAttributes are ignored, unless you disable the automatic size calculation, by saying setUseAutomaticMarkerSize( false )

Definition at line 641 of file KDChartLegend.cpp.

References d, and markerAttributes().

◆ setOrientation()

void Legend::setOrientation ( Qt::Orientation  orientation)

Definition at line 475 of file KDChartLegend.cpp.

References d, and orientation().

◆ setPen()

void Legend::setPen ( uint  dataset,
const QPen &  pen 
)

Definition at line 617 of file KDChartLegend.cpp.

References d, and pen().

◆ setPosition()

void Legend::setPosition ( Position  position)

Specify the position of a non-floating legend.

Use setFloatingPosition to set position and alignment if your legend is floating.

See also
setAlignment, setFloatingPosition

Definition at line 399 of file KDChartLegend.cpp.

References d, and position().

Referenced by KDChart::Widget::addLegend().

◆ setRainbowColors()

void Legend::setRainbowColors ( )

◆ setReferenceArea()

void Legend::setReferenceArea ( const QWidget *  area)

Specifies the reference area for font size of title text, and for font size of the item texts, IF automatic area detection is set.

Note
This parameter is ignored, if the Measure given for setTitleTextAttributes (or setTextAttributes, resp.) is not specifying automatic area detection.

If no reference area is specified, but automatic area detection is set, then the size of the legend's parent widget will be used.

See also
KDChart::Measure, KDChartEnums::MeasureCalculationMode

Definition at line 235 of file KDChartLegend.cpp.

References d.

◆ setShowLines()

void Legend::setShowLines ( bool  legendShowLines)

Definition at line 505 of file KDChartLegend.cpp.

References d.

◆ setSortOrder()

void Legend::setSortOrder ( Qt::SortOrder  order)

Definition at line 490 of file KDChartLegend.cpp.

References d.

◆ setSpacing()

void Legend::setSpacing ( uint  space)

Definition at line 720 of file KDChartLegend.cpp.

References d.

◆ setSubduedColors()

void Legend::setSubduedColors ( bool  ordered = false)

◆ setText()

void Legend::setText ( uint  dataset,
const QString &  text 
)

Definition at line 546 of file KDChartLegend.cpp.

References d, and text().

◆ setTextAlignment()

void Legend::setTextAlignment ( Qt::Alignment  alignment)

Specify the alignment of the text elements within the legend.

See also
textAlignment()

Definition at line 433 of file KDChartLegend.cpp.

References alignment(), and d.

◆ setTextAttributes()

void Legend::setTextAttributes ( const TextAttributes a)

Definition at line 667 of file KDChartLegend.cpp.

References d.

◆ setTitleText()

void Legend::setTitleText ( const QString &  text)

Definition at line 681 of file KDChartLegend.cpp.

References d, and text().

◆ setTitleTextAttributes()

void Legend::setTitleTextAttributes ( const TextAttributes a)

Definition at line 695 of file KDChartLegend.cpp.

References d.

◆ setUseAutomaticMarkerSize()

void Legend::setUseAutomaticMarkerSize ( bool  useAutomaticMarkerSize)

This option is on by default, it means that Marker sizes in the Legend will be the same as the font height used for their respective label texts.

Set this to false, if you want to specify the marker sizes via setMarkerAttributes or if you want the Legend to use the same marker sizes as they are used in the Diagrams.

Definition at line 520 of file KDChartLegend.cpp.

References d, and useAutomaticMarkerSize().

◆ setVisible()

void Legend::setVisible ( bool  visible)
override

Definition at line 385 of file KDChartLegend.cpp.

◆ showLines()

bool Legend::showLines ( ) const

Definition at line 515 of file KDChartLegend.cpp.

References d.

Referenced by compare(), and heightForWidth().

◆ sizeHint()

QSize Legend::sizeHint ( ) const
override

Definition at line 123 of file KDChartLegend.cpp.

References d.

Referenced by minimumSizeHint(), KDChart::Chart::reLayoutFloatingLegends(), and resizeEvent().

◆ sortOrder()

Qt::SortOrder Legend::sortOrder ( ) const

Definition at line 500 of file KDChartLegend.cpp.

References d.

◆ spacing()

uint Legend::spacing ( ) const

Definition at line 730 of file KDChartLegend.cpp.

References d.

Referenced by compare(), and heightForWidth().

◆ text()

QString Legend::text ( uint  dataset) const

Definition at line 555 of file KDChartLegend.cpp.

References d.

Referenced by setText(), and setTitleText().

◆ textAlignment()

Qt::Alignment Legend::textAlignment ( ) const

Returns the alignment used while rendering text elements within the legend.

See also
setTextAlignment()

Definition at line 442 of file KDChartLegend.cpp.

References d.

Referenced by clone(), and compare().

◆ textAttributes()

TextAttributes Legend::textAttributes ( ) const

Definition at line 676 of file KDChartLegend.cpp.

References d.

Referenced by clone(), and compare().

◆ texts()

const QMap< uint, QString > Legend::texts ( ) const

Definition at line 564 of file KDChartLegend.cpp.

References d.

Referenced by compare().

◆ titleText()

QString Legend::titleText ( ) const

Definition at line 690 of file KDChartLegend.cpp.

References d.

Referenced by compare().

◆ titleTextAttributes()

TextAttributes Legend::titleTextAttributes ( ) const

Definition at line 704 of file KDChartLegend.cpp.

References d.

Referenced by clone(), and compare().

◆ useAutomaticMarkerSize()

bool Legend::useAutomaticMarkerSize ( ) const

Definition at line 527 of file KDChartLegend.cpp.

References d.

Referenced by clone(), compare(), and setUseAutomaticMarkerSize().


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

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated by doxygen 1.9.1