KChart::Widget
#include <KChartWidget.h>
Public Types | |
enum | ChartType { NoType , Bar , Line , Plot , Pie , Ring , Polar } |
enum | SubType { Normal , Stacked , Percent , Rows } |
Public Types inherited from QWidget | |
enum | RenderFlag |
Public Types inherited from QPaintDevice | |
enum | PaintDeviceMetric |
Public Slots | |
void | setGlobalLeading (int left, int top, int right, int bottom) |
void | setGlobalLeadingBottom (int leading) |
void | setGlobalLeadingLeft (int leading) |
void | setGlobalLeadingRight (int leading) |
void | setGlobalLeadingTop (int leading) |
void | setSubType (KChart::Widget::SubType subType) |
void | setType (KChart::Widget::ChartType chartType, KChart::Widget::SubType subType=Normal) |
Detailed Description
The KChart widget for usage without Interwiev.
If you want to use KChart with Interview, use KChart::Chart instead.
Definition at line 45 of file KChartWidget.h.
Member Enumeration Documentation
◆ ChartType
enum KChart::Widget::ChartType |
Definition at line 193 of file KChartWidget.h.
◆ SubType
Sub type values, matching the values defines for the respective Diagram classes.
Definition at line 199 of file KChartWidget.h.
Constructor & Destructor Documentation
◆ Widget()
Standard Qt-style Constructor.
Creates a new widget with all data initialized empty.
- Parameters
-
parent the widget parent; passed on to QWidget
Definition at line 50 of file KChartWidget.cpp.
◆ ~Widget()
|
override |
Destructor.
Definition at line 58 of file KChartWidget.cpp.
Member Function Documentation
◆ addHeaderFooter() [1/2]
void Widget::addHeaderFooter | ( | const QString & | text, |
HeaderFooter::HeaderFooterType | type, | ||
Position | position ) |
Adds a new header/footer with the given text to the position.
Definition at line 200 of file KChartWidget.cpp.
◆ addHeaderFooter() [2/2]
void Widget::addHeaderFooter | ( | HeaderFooter * | header | ) |
Adds the existing header / footer object header.
- See also
- replaceHeaderFooter, takeHeaderFooter
Definition at line 211 of file KChartWidget.cpp.
◆ addLegend() [1/2]
Adds a new, already existing, legend.
Definition at line 245 of file KChartWidget.cpp.
◆ addLegend() [2/2]
Adds an empty legend on the given position.
Definition at line 238 of file KChartWidget.cpp.
◆ allHeadersFooters()
QList< KChart::HeaderFooter * > Widget::allHeadersFooters | ( | ) |
Returns a list with all headers.
Definition at line 195 of file KChartWidget.cpp.
◆ allLegends()
QList< KChart::Legend * > Widget::allLegends | ( | ) |
Returns a list with all legends.
Definition at line 233 of file KChartWidget.cpp.
◆ barDiagram()
BarDiagram * Widget::barDiagram | ( | ) |
If the current diagram is a BarDiagram, it is returned; otherwise 0 is returned.
This function provides type-safe casting.
Definition at line 272 of file KChartWidget.cpp.
◆ coordinatePlane()
AbstractCoordinatePlane * Widget::coordinatePlane | ( | ) |
Returns a pointer to the current coordinate plane.
Definition at line 297 of file KChartWidget.cpp.
◆ diagram()
AbstractDiagram * Widget::diagram | ( | ) |
Returns a pointer to the current diagram.
Definition at line 264 of file KChartWidget.cpp.
◆ firstHeaderFooter()
KChart::HeaderFooter * Widget::firstHeaderFooter | ( | ) |
Returns the first of all headers.
Definition at line 190 of file KChartWidget.cpp.
◆ globalLeadingBottom()
int Widget::globalLeadingBottom | ( | ) | const |
Returns the bottom leading (border).
Definition at line 185 of file KChartWidget.cpp.
◆ globalLeadingLeft()
int Widget::globalLeadingLeft | ( | ) | const |
Returns the left leading (border).
Definition at line 155 of file KChartWidget.cpp.
◆ globalLeadingRight()
int Widget::globalLeadingRight | ( | ) | const |
Returns the right leading (border).
Definition at line 175 of file KChartWidget.cpp.
◆ globalLeadingTop()
int Widget::globalLeadingTop | ( | ) | const |
Returns the top leading (border).
Definition at line 165 of file KChartWidget.cpp.
◆ legend()
KChart::Legend * Widget::legend | ( | ) |
Returns the first of all legends.
Definition at line 228 of file KChartWidget.cpp.
◆ lineDiagram()
LineDiagram * Widget::lineDiagram | ( | ) |
If the current diagram is a LineDiagram, it is returned; otherwise 0 is returned.
This function provides type-safe casting.
Definition at line 276 of file KChartWidget.cpp.
◆ pieDiagram()
PieDiagram * Widget::pieDiagram | ( | ) |
If the current diagram is a Plotter, it is returned; otherwise 0 is returned.
This function provides type-safe casting.
Definition at line 284 of file KChartWidget.cpp.
◆ plotter()
Plotter * Widget::plotter | ( | ) |
If the current diagram is a LineDiagram, it is returned; otherwise 0 is returned.
This function provides type-safe casting.
- Note
- Do not use lineDiagram for multi-dimensional diagrams, but use plotter instead
- See also
- plotter
Definition at line 280 of file KChartWidget.cpp.
◆ polarDiagram()
PolarDiagram * Widget::polarDiagram | ( | ) |
If the current diagram is a PolarDiagram, it is returned; otherwise 0 is returned.
This function provides type-safe casting.
Definition at line 292 of file KChartWidget.cpp.
◆ replaceHeaderFooter()
void Widget::replaceHeaderFooter | ( | HeaderFooter * | header, |
HeaderFooter * | oldHeader = nullptr ) |
Replaces the old header (or footer, resp.), or appends the new header or footer, it there is none yet.
- Parameters
-
header The header or footer to be used instead of the old one. This parameter must not be zero, or the method will do nothing. oldHeader The header or footer to be removed by the new one. This header or footer will be deleted automatically. If the parameter is omitted, the very first header or footer will be replaced. In case, there was no header and no footer yet, the new header or footer will just be added.
- Note
- If you want to re-use the old header or footer, call takeHeaderFooter and addHeaderFooter, instead of using replaceHeaderFooter.
- See also
- addHeaderFooter, takeHeaderFooter
Definition at line 217 of file KChartWidget.cpp.
◆ replaceLegend()
Definition at line 252 of file KChartWidget.cpp.
◆ resetData()
void Widget::resetData | ( | ) |
Resets all data.
Definition at line 139 of file KChartWidget.cpp.
◆ ringDiagram()
RingDiagram * Widget::ringDiagram | ( | ) |
If the current diagram is a RingDiagram, it is returned; otherwise 0 is returned.
This function provides type-safe casting.
Definition at line 288 of file KChartWidget.cpp.
◆ setDataCell() [1/2]
Sets the data for a given column using an (X, Y) QPair of qreals.
Definition at line 120 of file KChartWidget.cpp.
◆ setDataCell() [2/2]
void Widget::setDataCell | ( | int | row, |
int | column, | ||
qreal | data ) |
Sets the Y value data for a given cell.
Definition at line 107 of file KChartWidget.cpp.
◆ setDataset() [1/2]
void Widget::setDataset | ( | int | column, |
const QVector< QPair< qreal, qreal > > & | data, | ||
const QString & | title = QString() ) |
Sets the data in the given column using a QVector of QPairs of qreal for the (X, Y) values.
Definition at line 85 of file KChartWidget.cpp.
◆ setDataset() [2/2]
void Widget::setDataset | ( | int | column, |
const QVector< qreal > & | data, | ||
const QString & | title = QString() ) |
Sets the data in the given column using a QVector of qreal for the Y values.
Definition at line 67 of file KChartWidget.cpp.
◆ setGlobalLeading
|
slot |
Sets all global leadings (borders).
Definition at line 145 of file KChartWidget.cpp.
◆ setGlobalLeadingBottom
|
slot |
Sets the bottom leading (border).
Definition at line 180 of file KChartWidget.cpp.
◆ setGlobalLeadingLeft
|
slot |
Sets the left leading (border).
Definition at line 150 of file KChartWidget.cpp.
◆ setGlobalLeadingRight
|
slot |
Sets the right leading (border).
Definition at line 170 of file KChartWidget.cpp.
◆ setGlobalLeadingTop
|
slot |
Sets the top leading (border).
Definition at line 160 of file KChartWidget.cpp.
◆ setSubType
|
slot |
Sets the type of the chart without changing the main type.
Make sure to use a sub-type that matches the main type, so e.g. setting sub-type Rows makes sense for Bar charts only, and it will be ignored for all other chart types.
- See also
- KChart::BarDiagram::BarType, KChart::LineDiagram::LineType
- KChart::PieDiagram::PieType, KChart::RingDiagram::RingType
- KChart::PolarDiagram::PolarType
Definition at line 403 of file KChartWidget.cpp.
◆ setType
|
slot |
Sets the type of the chart.
Definition at line 314 of file KChartWidget.cpp.
◆ subType()
Widget::SubType Widget::subType | ( | ) | const |
Returns the sub-type of the chart.
Definition at line 453 of file KChartWidget.cpp.
◆ takeHeaderFooter()
void Widget::takeHeaderFooter | ( | HeaderFooter * | header | ) |
Remove the header (or footer, resp.) from the widget, without deleting it.
The chart no longer owns the header or footer, so it is the caller's responsibility to delete the header or footer.
- See also
- addHeaderFooter, replaceHeaderFooter
Definition at line 223 of file KChartWidget.cpp.
◆ takeLegend()
Definition at line 259 of file KChartWidget.cpp.
◆ type()
Widget::ChartType Widget::type | ( | ) | const |
Returns the type of the chart.
Definition at line 433 of file KChartWidget.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:24 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.