File indexing completed on 2024-05-12 04:43:20

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Lesser General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2.1 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0012  * Lesser General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Lesser General Public
0015  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0016  */
0017 
0018 #include "krscriptchart.h"
0019 #include "KReportItemChart.h"
0020 
0021 namespace Scripting
0022 {
0023 
0024 Chart::Chart(KReportItemChart *c)
0025 {
0026     m_chart = c;
0027 }
0028 
0029 
0030 Chart::~Chart()
0031 {
0032 }
0033 
0034 QPointF Chart::position()
0035 {
0036     return m_chart->m_pos.toPoint();
0037 }
0038 void Chart::setPosition(const QPointF& p)
0039 {
0040     m_chart->m_pos.setPointPos(p);
0041 }
0042 
0043 QSizeF Chart::size()
0044 {
0045     return m_chart->m_size.toPoint();
0046 }
0047 void Chart::setSize(const QSizeF& s)
0048 {
0049     m_chart->m_size.setPointSize(s);
0050 }
0051 
0052 QString Chart::dataSource()
0053 {
0054     return m_chart->itemDataSource();
0055 }
0056 
0057 void Chart::setDataSource(const QString &ds)
0058 {
0059     m_chart->setItemDataSource(ds);
0060 }
0061 
0062 bool Chart::threeD()
0063 {
0064     return m_chart->m_threeD->value().toBool();
0065 }
0066 
0067 void Chart::setThreeD(bool td)
0068 {
0069     m_chart->m_threeD->setValue(td);
0070 }
0071 
0072 bool Chart::legendVisible()
0073 {
0074     return m_chart->m_displayLegend->value().toBool();
0075 }
0076 
0077 void Chart::setLegendVisible(bool v)
0078 {
0079     m_chart->m_displayLegend->setValue(v);
0080 }
0081 
0082 int Chart::colorScheme()
0083 {
0084     return m_chart->m_colorScheme->value().toInt();
0085 }
0086 
0087 void Chart::setColorScheme(int cs)
0088 {
0089     m_chart->m_colorScheme->setValue(cs);
0090 }
0091 
0092 QColor Chart::backgroundColor()
0093 {
0094     return m_chart->m_backgroundColor->value().value<QColor>();
0095 }
0096 
0097 void Chart::setBackgroundColor(const QColor &bc)
0098 {
0099     m_chart->m_backgroundColor->setValue(bc);
0100 }
0101 
0102 QString Chart::xAxisTitle()
0103 {
0104     return m_chart->m_xTitle->value().toString();
0105 }
0106 
0107 void Chart::setXAxisTitle(const QString &t)
0108 {
0109     m_chart->m_xTitle->setValue(t);
0110 }
0111 
0112 QString Chart::yAxisTitle()
0113 {
0114     return m_chart->m_yTitle->value().toString();
0115 }
0116 
0117 void Chart::setYAxisTitle(const QString &t)
0118 {
0119     m_chart->m_yTitle->setValue(t);
0120 }
0121 }