KD Chart 2  [rev.2.5.1]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected 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:
Inheritance graph
[legend]
Collaboration diagram for KDChart::Legend:
Collaboration graph
[legend]

Public Types

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

Signals

void destroyedLegend (Legend *)
 
void positionChanged (AbstractAreaWidget *)
 
void propertiesChanged ()
 Emitted upon change of a property of the Legend or any of its components. More...
 

Public Member Functions

void addDiagram (KDChart::AbstractDiagram *newDiagram)
 Add the given diagram to the legend. More...
 
Qt::Alignment alignment () const
 Returns the alignment of a non-floating legend. More...
 
void alignToReferencePoint (const RelativePosition &position)
 
BackgroundAttributes backgroundAttributes () const
 
QBrush brush (uint dataset) const
 
const QMap< uint, QBrush > brushes () const
 
virtual Legendclone () const
 Creates an exact copy of this legend. More...
 
bool compare (const AbstractAreaBase *other) const
 Returns true if both areas have the same settings. More...
 
bool compare (const Legend *other) const
 Returns true if both legends have the same settings. More...
 
ConstDiagramList constDiagrams () const
 
uint datasetCount () const
 
bool datasetIsHidden (uint dataset) const
 
uint dataSetOffset (KDChart::AbstractDiagram *diagram)
 Returns the offset of the first dataset of diagram. More...
 
KDChart::AbstractDiagramdiagram () const
 The first diagram of the legend or 0 if there was none added to the legend. More...
 
DiagramList diagrams () const
 The list of all diagrams associated with the legend. More...
 
const RelativePosition floatingPosition () const
 Returns the position of a floating legend. More...
 
virtual void forceRebuild ()
 Call this to trigger an unconditional re-building of the widget's internals. More...
 
FrameAttributes frameAttributes () const
 
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
 
const QList< uint > hiddenDatasets () const
 
 Legend (QWidget *parent=0)
 
 Legend (KDChart::AbstractDiagram *diagram, QWidget *parent)
 
LegendStyle legendStyle () const
 
Qt::Alignment legendSymbolAlignment () const
 Returns the alignment used while drawing legend symbol(alignment of Legend::LinesOnly) within the legend. More...
 
MarkerAttributes markerAttributes (uint dataset) const
 
const QMap< uint,
MarkerAttributes
markerAttributes () const
 
virtual QSize minimumSizeHint () const
 
virtual void needSizeHint ()
 Call this to trigger an conditional re-building of the widget's internals. More...
 
Qt::Orientation orientation () const
 
virtual void paint (QPainter *painter)
 Overwrite this to paint the inner contents of your widget. More...
 
void paintAll (QPainter &painter)
 Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically. More...
 
virtual void paintBackground (QPainter &painter, const QRect &rectangle)
 
virtual void paintEvent (QPaintEvent *event)
 Draws the background and frame, then calls paint(). More...
 
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint(). More...
 
QPen pen (uint dataset) const
 
const QMap< uint, QPen > pens () const
 
Position position () const
 Returns the position of a non-floating legend. More...
 
const QWidgetreferenceArea () 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. More...
 
void removeDiagram (KDChart::AbstractDiagram *oldDiagram)
 Removes the diagram from the legend's list of diagrams. More...
 
void removeDiagrams ()
 Removes all diagrams from the legend's list of diagrams. More...
 
void replaceDiagram (KDChart::AbstractDiagram *newDiagram, KDChart::AbstractDiagram *oldDiagram=0)
 Replaces the old diagram, or appends the new diagram, it there is none yet. More...
 
void resetTexts ()
 Removes all legend texts that might have been set by setText. More...
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void resizeLayout (const QSize &size)
 
void setAlignment (Qt::Alignment)
 Specify the alignment of a non-floating legend. More...
 
void setBackgroundAttributes (const BackgroundAttributes &a)
 
void setBrush (uint dataset, const QBrush &brush)
 
void setBrushesFromDiagram (KDChart::AbstractDiagram *diagram)
 
void 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. More...
 
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)
 Specify the position and alignment of a floating legend. More...
 
void setFrameAttributes (const FrameAttributes &a)
 
void setHiddenDatasets (const QList< uint > hiddenDatasets)
 Sets a list of datasets that are to be hidden in the legend. More...
 
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 &)
 Note that any sizes specified via setMarkerAttributes are ignored, unless you disable the automatic size calculation, by saying setUseAutomaticMarkerSize( false ) More...
 
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)
 Specifies the reference area for font size of title text, and for font size of the item texts, IF automatic area detection is set. More...
 
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)
 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. More...
 
virtual void setVisible (bool visible)
 
bool showLines () const
 
virtual QSize sizeHint () const
 
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
 
virtual ~Legend ()
 

Static Public Member Functions

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

virtual QRect areaGeometry () const
 
QRect innerRect () const
 
virtual void positionHasChanged ()
 

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 embedd 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 55 of file KDChartLegend.h.

Member Enumeration Documentation

Enumerator
MarkersOnly 
LinesOnly 
MarkersAndLines 

Definition at line 68 of file KDChartLegend.h.

Constructor & Destructor Documentation

Legend::Legend ( QWidget parent = 0)
explicit

Definition at line 85 of file KDChartLegend.cpp.

References d.

Referenced by clone().

Legend::Legend ( KDChart::AbstractDiagram diagram,
QWidget parent 
)
explicit

Definition at line 92 of file KDChartLegend.cpp.

References d, and setDiagram().

Legend::~Legend ( )
virtual

Definition at line 100 of file KDChartLegend.cpp.

References destroyedLegend().

Member Function Documentation

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

Add the given diagram to the legend.

Parameters
newDiagramThe diagram to add.
See Also
diagram, diagrams, removeDiagram, removeDiagrams, replaceDiagram, setDiagram

Definition at line 318 of file KDChartLegend.cpp.

References d.

Referenced by replaceDiagram().

Qt::Alignment Legend::alignment ( ) const

Returns the alignment of a non-floating legend.

See Also
setAlignment

Definition at line 470 of file KDChartLegend.cpp.

References d.

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

void AbstractAreaBase::alignToReferencePoint ( const RelativePosition position)
inherited

Definition at line 81 of file KDChartAbstractAreaBase.cpp.

QRect AbstractAreaWidget::areaGeometry ( ) const
protectedvirtualinherited

Implements KDChart::AbstractAreaBase.

Definition at line 178 of file KDChartAbstractAreaWidget.cpp.

BackgroundAttributes AbstractAreaBase::backgroundAttributes ( ) const
inherited

Definition at line 111 of file KDChartAbstractAreaBase.cpp.

References d.

Referenced by KDChart::AbstractAreaBase::compare(), and updateCommonBrush().

QBrush Legend::brush ( uint  dataset) const

Definition at line 619 of file KDChartLegend.cpp.

References d.

Referenced by setBrush().

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

Definition at line 628 of file KDChartLegend.cpp.

References d.

Referenced by compare().

Legend * Legend::clone ( ) const
virtual
bool AbstractAreaBase::compare ( const AbstractAreaBase other) const
inherited

Returns true if both areas have the same settings.

Definition at line 71 of file KDChartAbstractAreaBase.cpp.

References KDChart::AbstractAreaBase::backgroundAttributes(), and KDChart::AbstractAreaBase::frameAttributes().

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

Definition at line 310 of file KDChartLegend.cpp.

References d.

uint Legend::datasetCount ( ) const
bool Legend::datasetIsHidden ( uint  dataset) const

Definition at line 1079 of file KDChartLegend.cpp.

References d.

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

Returns the offset of the first dataset of diagram.

Definition at line 399 of file KDChartLegend.cpp.

References d, and diagram().

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

Referenced by ~Legend().

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 295 of file KDChartLegend.cpp.

References d.

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

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 302 of file KDChartLegend.cpp.

References d.

Referenced by removeDiagram(), and removeDiagrams().

const RelativePosition Legend::floatingPosition ( ) const

Returns the position of a floating legend.

See Also
setFloatingPosition

Definition at line 511 of file KDChartLegend.cpp.

References d.

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

void Legend::forceRebuild ( )
virtual

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

Reimplemented from KDChart::AbstractAreaWidget.

Definition at line 732 of file KDChartLegend.cpp.

Referenced by resizeEvent().

FrameAttributes AbstractAreaBase::frameAttributes ( ) const
inherited

Definition at line 97 of file KDChartAbstractAreaBase.cpp.

References d.

Referenced by clone(), KDChart::AbstractAreaBase::compare(), and updateCommonBrush().

void AbstractAreaBase::getFrameLeadings ( int &  left,
int &  top,
int &  right,
int &  bottom 
) const
inherited
const QList< uint > Legend::hiddenDatasets ( ) const

Definition at line 1066 of file KDChartLegend.cpp.

References d.

Referenced by setHiddenDatasets().

QRect AbstractAreaBase::innerRect ( ) const
protectedinherited
Legend::LegendStyle Legend::legendStyle ( ) const

Definition at line 196 of file KDChartLegend.cpp.

References d.

Referenced by clone(), and compare().

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 497 of file KDChartLegend.cpp.

References d.

MarkerAttributes Legend::markerAttributes ( uint  dataset) const

Definition at line 681 of file KDChartLegend.cpp.

References d.

Referenced by compare().

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

Definition at line 690 of file KDChartLegend.cpp.

References d.

Referenced by compare(), and setMarkerAttributes().

QSize Legend::minimumSizeHint ( ) const
virtual

Definition at line 143 of file KDChartLegend.cpp.

References sizeHint().

void Legend::needSizeHint ( )
virtual

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 161 of file KDChartLegend.cpp.

Qt::Orientation Legend::orientation ( ) const

Definition at line 524 of file KDChartLegend.cpp.

References d.

Referenced by compare(), and setOrientation().

void Legend::paint ( QPainter *  painter)
virtual

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 247 of file KDChartLegend.cpp.

References d, diagram(), and KDChart::AbstractLayoutItem::paint().

void AbstractAreaWidget::paintAll ( QPainter &  painter)
inherited
void AbstractAreaBase::paintBackground ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintBackgroundAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::BackgroundAttributes attributes 
)
staticinherited
void AbstractAreaWidget::paintEvent ( QPaintEvent *  event)
virtualinherited

Draws the background and frame, then calls paint().

In most cases there is no need to overwrite this method in a derived class, but you would overwrite paint() instead.

See Also
paint

Definition at line 96 of file KDChartAbstractAreaWidget.cpp.

References d, and KDChart::AbstractAreaWidget::paintAll().

void AbstractAreaBase::paintFrame ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintFrameAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::FrameAttributes attributes 
)
staticinherited
void AbstractAreaWidget::paintIntoRect ( QPainter &  painter,
const QRect &  rect 
)
virtualinherited

Draws the background and frame, then calls paint().

In most cases there is no need to overwrite this method in a derived class, but you would overwrite paint() instead.

Definition at line 106 of file KDChartAbstractAreaWidget.cpp.

References d, and KDChart::AbstractAreaWidget::paintAll().

QPen Legend::pen ( uint  dataset) const

Definition at line 659 of file KDChartLegend.cpp.

References d.

Referenced by setPen().

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

Definition at line 667 of file KDChartLegend.cpp.

References d.

Referenced by compare().

Position Legend::position ( ) const

Returns the position of a non-floating legend.

See Also
setPosition

Definition at line 457 of file KDChartLegend.cpp.

References d.

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

void KDChart::AbstractAreaWidget::positionChanged ( AbstractAreaWidget )
signalinherited
void AbstractAreaWidget::positionHasChanged ( )
protectedvirtualinherited
void KDChart::Legend::propertiesChanged ( )
signal

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

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 289 of file KDChartLegend.cpp.

References d.

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 343 of file KDChartLegend.cpp.

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

Referenced by removeDiagrams(), and replaceDiagram().

void Legend::removeDiagrams ( )

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

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

Definition at line 373 of file KDChartLegend.cpp.

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

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

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 384 of file KDChartLegend.cpp.

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

Referenced by setDiagram().

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 573 of file KDChartLegend.cpp.

References d.

void Legend::resizeEvent ( QResizeEvent *  event)
virtual

Definition at line 793 of file KDChartLegend.cpp.

References forceRebuild(), and sizeHint().

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

Reimplemented from KDChart::AbstractAreaWidget.

Definition at line 168 of file KDChartLegend.cpp.

References d.

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 462 of file KDChartLegend.cpp.

References alignment(), and d.

Referenced by clone().

void AbstractAreaBase::setBackgroundAttributes ( const BackgroundAttributes a)
inherited
void Legend::setBrush ( uint  dataset,
const QBrush &  brush 
)

Definition at line 610 of file KDChartLegend.cpp.

References brush(), and d.

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

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

Definition at line 634 of file KDChartLegend.cpp.

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

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 601 of file KDChartLegend.cpp.

References d.

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

Definition at line 1071 of file KDChartLegend.cpp.

References d.

void Legend::setDefaultColors ( )
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 418 of file KDChartLegend.cpp.

References replaceDiagram().

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

void Legend::setFloatingPosition ( const RelativePosition relativePosition)

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 502 of file KDChartLegend.cpp.

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

void AbstractAreaBase::setFrameAttributes ( const FrameAttributes a)
inherited

Definition at line 88 of file KDChartAbstractAreaBase.cpp.

References d, and KDChart::AbstractAreaBase::positionHasChanged().

Referenced by clone().

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 1061 of file KDChartLegend.cpp.

References d, and hiddenDatasets().

void Legend::setLegendStyle ( LegendStyle  style)

Definition at line 189 of file KDChartLegend.cpp.

References d.

Referenced by clone().

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 488 of file KDChartLegend.cpp.

References alignment(), and d.

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 673 of file KDChartLegend.cpp.

References d, and markerAttributes().

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

Definition at line 516 of file KDChartLegend.cpp.

References d, and orientation().

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

Definition at line 651 of file KDChartLegend.cpp.

References d, and pen().

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 442 of file KDChartLegend.cpp.

References d, and position().

Referenced by KDChart::Widget::addLegend(), and clone().

void Legend::setRainbowColors ( )
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 282 of file KDChartLegend.cpp.

References d.

void Legend::setShowLines ( bool  legendShowLines)

Definition at line 543 of file KDChartLegend.cpp.

References d.

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

Definition at line 529 of file KDChartLegend.cpp.

References d.

void Legend::setSpacing ( uint  space)

Definition at line 744 of file KDChartLegend.cpp.

References d.

void Legend::setSubduedColors ( bool  ordered = false)
void Legend::setText ( uint  dataset,
const QString &  text 
)

Definition at line 580 of file KDChartLegend.cpp.

References d, and text().

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

Specify the alignment of the text elements within the legend.

See Also
textAlignment()

Definition at line 475 of file KDChartLegend.cpp.

References alignment(), and d.

Referenced by clone().

void Legend::setTextAttributes ( const TextAttributes a)

Definition at line 696 of file KDChartLegend.cpp.

References d.

Referenced by clone().

void Legend::setTitleText ( const QString &  text)

Definition at line 708 of file KDChartLegend.cpp.

References d, and text().

void Legend::setTitleTextAttributes ( const TextAttributes a)

Definition at line 720 of file KDChartLegend.cpp.

References d.

Referenced by clone().

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 556 of file KDChartLegend.cpp.

References d, and useAutomaticMarkerSize().

Referenced by clone().

void Legend::setVisible ( bool  visible)
virtual

Definition at line 428 of file KDChartLegend.cpp.

bool Legend::showLines ( ) const

Definition at line 551 of file KDChartLegend.cpp.

References d.

Referenced by compare().

QSize Legend::sizeHint ( ) const
virtual

Definition at line 150 of file KDChartLegend.cpp.

References d.

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

Qt::SortOrder Legend::sortOrder ( ) const

Definition at line 538 of file KDChartLegend.cpp.

References d.

uint Legend::spacing ( ) const

Definition at line 752 of file KDChartLegend.cpp.

References d.

Referenced by compare().

QString Legend::text ( uint  dataset) const

Definition at line 587 of file KDChartLegend.cpp.

References d.

Referenced by setText(), and setTitleText().

Qt::Alignment Legend::textAlignment ( ) const

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

See Also
setTextAlignment()

Definition at line 483 of file KDChartLegend.cpp.

References d.

Referenced by clone(), and compare().

TextAttributes Legend::textAttributes ( ) const

Definition at line 703 of file KDChartLegend.cpp.

References d.

Referenced by clone(), and compare().

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

Definition at line 596 of file KDChartLegend.cpp.

References d.

Referenced by compare().

QString Legend::titleText ( ) const

Definition at line 715 of file KDChartLegend.cpp.

References d.

Referenced by compare().

TextAttributes Legend::titleTextAttributes ( ) const

Definition at line 727 of file KDChartLegend.cpp.

References d.

Referenced by clone(), and compare().

bool Legend::useAutomaticMarkerSize ( ) const

Definition at line 563 of file KDChartLegend.cpp.

References d.

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


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

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/