KReport

KReportScriptChart.cpp
1 /* This file is part of the KDE project
2  * Copyright (C) 2007-2008 by Adam Pigg ([email protected])
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 
21 namespace Scripting
22 {
23 
24 Chart::Chart(KReportItemChart *c)
25 {
26  m_chart = c;
27 }
28 
29 
30 Chart::~Chart()
31 {
32 }
33 
34 QPointF Chart::position()
35 {
36  return m_chart->m_pos.toPoint();
37 }
38 void Chart::setPosition(const QPointF& p)
39 {
40  m_chart->m_pos.setPointPos(p);
41 }
42 
44 {
45  return m_chart->m_size.toPoint();
46 }
47 void Chart::setSize(const QSizeF& s)
48 {
49  m_chart->m_size.setPointSize(s);
50 }
51 
52 QString Chart::dataSource()
53 {
54  return m_chart->itemDataSource();
55 }
56 
57 void Chart::setDataSource(const QString &ds)
58 {
59  m_chart->setItemDataSource(ds);
60 }
61 
62 bool Chart::threeD()
63 {
64  return m_chart->m_threeD->value().toBool();
65 }
66 
67 void Chart::setThreeD(bool td)
68 {
69  m_chart->m_threeD->setValue(td);
70 }
71 
72 bool Chart::legendVisible()
73 {
74  return m_chart->m_displayLegend->value().toBool();
75 }
76 
77 void Chart::setLegendVisible(bool v)
78 {
79  m_chart->m_displayLegend->setValue(v);
80 }
81 
82 int Chart::colorScheme()
83 {
84  return m_chart->m_colorScheme->value().toInt();
85 }
86 
87 void Chart::setColorScheme(int cs)
88 {
89  m_chart->m_colorScheme->setValue(cs);
90 }
91 
92 QColor Chart::backgroundColor()
93 {
94  return m_chart->m_backgroundColor->value().value<QColor>();
95 }
96 
97 void Chart::setBackgroundColor(const QColor &bc)
98 {
99  m_chart->m_backgroundColor->setValue(bc);
100 }
101 
102 QString Chart::xAxisTitle()
103 {
104  return m_chart->m_xTitle->value().toString();
105 }
106 
107 void Chart::setXAxisTitle(const QString &t)
108 {
109  m_chart->m_xTitle->setValue(t);
110 }
111 
112 QString Chart::yAxisTitle()
113 {
114  return m_chart->m_yTitle->value().toString();
115 }
116 
117 void Chart::setYAxisTitle(const QString &t)
118 {
119  m_chart->m_yTitle->setValue(t);
120 }
121 }
QSizeF size() const const
void setSize(const QSizeF &size)
int toInt(bool *ok, int base) const const
int value() const const
Field item script interface.
QPoint toPoint() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:17:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.