#include <KDReportsChartElement.h>
The KDReports::ChartElement class represents a chart in the report. The data is provided by a QAbstractItemModel.
KDReports::ChartElement::ChartElement |
( |
QAbstractItemModel * |
tableModel | ) |
|
|
explicit |
Creates a chart element from the given table model.
KDReports::ChartElement::ChartElement |
( |
const QString & |
modelKey | ) |
|
|
explicit |
KDReports::ChartElement::ChartElement |
( |
KDChart::Chart * |
chart | ) |
|
|
explicit |
Creates a chart element from the given chart.
The chart's ownership is NOT transferred. It is very important that the chart exists at least as long as the report object exists.
- Since
- 1.3
virtual KDReports::ChartElement::~ChartElement |
( |
| ) |
|
|
virtual |
Destroys this chart element.
KDReports::ChartElement::ChartElement |
( |
const ChartElement & |
other | ) |
|
Copies the data from another chart element.
void KDReports::ChartElement::setChart |
( |
KDChart::Chart * |
chart | ) |
|
Sets the chart to use in this chart element. Useful for associating a chart to a ChartElement from XmlElementHandler.
The chart's ownership is NOT transferred. It is very important that the chart exists at least as long as the report object exists.
- Since
- 1.3
void KDReports::ChartElement::setModelKey |
( |
const QString & |
modelKey | ) |
|
set the model key associated with this element
- Since
- 1.4
void KDReports::ChartElement::setSize |
( |
qreal |
width, |
|
|
qreal |
height, |
|
|
Unit |
unit = Millimeters |
|
) |
| |
Sets the size of the chart. The default size is a 100% of the page width, for both width and height.
To set a chart size that adapts well to any page size, use Percent as unit. setSize(50, 75, Percent) means that the width will be half of the page width (without margins), and the height will always be 1.5 times the width (preserving the ratio between 50 and 75). This feature (Percent) leads to slightly worse results on screen at 100% zoom, due to scaling happening even at that size, but the printed report should be fine.
void KDReports::ChartElement::setTableModel |
( |
QAbstractItemModel * |
tableModel | ) |
|
set the model associated with this element
- Since
- 1.4
QSizeF KDReports::ChartElement::size |
( |
| ) |
const |
- Returns
- the size of the chart, use unit() to know the size unit
- Since
- 1.4
Unit KDReports::ChartElement::unit |
( |
| ) |
const |
- Returns
- the size unit
- Since
- 1.4
The documentation for this class was generated from the following file: