KReport

KReportScriptChart.cpp
1/* This file is part of the KDE project
2 * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "krscriptchart.h"
19#include "KReportItemChart.h"
20
21namespace Scripting
22{
23
24Chart::Chart(KReportItemChart *c)
25{
26 m_chart = c;
27}
28
29
30Chart::~Chart()
31{
32}
33
34QPointF Chart::position()
35{
36 return m_chart->m_pos.toPoint();
37}
38void Chart::setPosition(const QPointF& p)
39{
40 m_chart->m_pos.setPointPos(p);
41}
42
44{
45 return m_chart->m_size.toPoint();
46}
47void Chart::setSize(const QSizeF& s)
48{
49 m_chart->m_size.setPointSize(s);
50}
51
52QString Chart::dataSource()
53{
54 return m_chart->itemDataSource();
55}
56
57void Chart::setDataSource(const QString &ds)
58{
59 m_chart->setItemDataSource(ds);
60}
61
62bool Chart::threeD()
63{
64 return m_chart->m_threeD->value().toBool();
65}
66
67void Chart::setThreeD(bool td)
68{
69 m_chart->m_threeD->setValue(td);
70}
71
72bool Chart::legendVisible()
73{
74 return m_chart->m_displayLegend->value().toBool();
75}
76
77void Chart::setLegendVisible(bool v)
78{
79 m_chart->m_displayLegend->setValue(v);
80}
81
82int Chart::colorScheme()
83{
84 return m_chart->m_colorScheme->value().toInt();
85}
86
87void Chart::setColorScheme(int cs)
88{
89 m_chart->m_colorScheme->setValue(cs);
90}
91
92QColor Chart::backgroundColor()
93{
94 return m_chart->m_backgroundColor->value().value<QColor>();
95}
96
97void Chart::setBackgroundColor(const QColor &bc)
98{
99 m_chart->m_backgroundColor->setValue(bc);
100}
101
102QString Chart::xAxisTitle()
103{
104 return m_chart->m_xTitle->value().toString();
105}
106
107void Chart::setXAxisTitle(const QString &t)
108{
109 m_chart->m_xTitle->setValue(t);
110}
111
112QString Chart::yAxisTitle()
113{
114 return m_chart->m_yTitle->value().toString();
115}
116
117void Chart::setYAxisTitle(const QString &t)
118{
119 m_chart->m_yTitle->setValue(t);
120}
121}
QVariant value() const
bool setValue(const QVariant &value, ValueOptions options=ValueOptions())
QString itemDataSource() const
Field item script interface.
void setSize(const QSizeF &size)
QSizeF size() const const
bool toBool() const const
int toInt(bool *ok) const const
QString toString() const const
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.