diff --git a/examples/chartview/chartview.pro b/examples/chartview/chartview.pro deleted file mode 100644 index 029b661..0000000 --- a/examples/chartview/chartview.pro +++ /dev/null @@ -1,6 +0,0 @@ -!include( ../examples.pri ) { - error( "Couldn't find the examples.pri file!" ) -} - -TARGET = chartview -SOURCES += main.cpp diff --git a/examples/chartview/main.cpp b/examples/chartview/main.cpp deleted file mode 100644 index 4e9e28c..0000000 --- a/examples/chartview/main.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QTCOMMERCIALCHART_USE_NAMESPACE - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - - //! [1] - // Create chart view - QChartView *chartView = new QChartView(); - chartView->setRenderHint(QPainter::Antialiasing); - chartView->setChartTitle("Simple Line Chart"); - // Add series to the chart - QLineSeries *line = new QLineSeries(); - line->append(0.0, 0.8); - line->append(1.1, 1.1); - line->append(2.0, 2.5); - chartView->addSeries(line); - //! [1] - - chartView->setChartTitle("\'Scietific\' theme"); - //! [2] - // Change theme - chartView->setChartTheme(QChart::ChartThemeHighContrast); - //! [2] - - chartView->setChartTitle("Simple Pie Chart"); - //! [3] - // Add pie series - // ... - QPieSeries *pie = new QPieSeries(); - pie->append(3.4, "slice1"); - pie->append(6.7, "slice2"); - chartView->addSeries(pie); - //! [3] - - chartView->setChartTitle("Simple Scatter Chart"); - //! [4] - // Add scatter series - // ... - QScatterSeries *scatter = new QScatterSeries(); - for (qreal x(0); x < 100; x += 0.5) { - qreal y = rand() % 100; - *(scatter) << QPointF(x, y); - } - chartView->addSeries(scatter); - //! [4] - - chartView->setChartTitle("Simple Bar Chart"); - //! [5] - // ... - // Add bar series - QStringList barCategory; - barCategory << "Jan" - << "Feb" - << "Mar"; - QBarSeries *bar = new QBarSeries(barCategory); - QBarSet *barSet = new QBarSet("Sales"); - *barSet << 123.2 - << 301.3 - << 285.8; - bar->addBarSet(barSet); - chartView->addSeries(bar); - //! [5] - - QMainWindow w; - w.resize(400, 300); - w.setCentralWidget(chartView); - w.setWindowFlags(Qt::FramelessWindowHint); - w.show(); - - return a.exec(); -} diff --git a/examples/dynamiclinechart/dynamiclinechart.pro b/examples/dynamiclinechart/dynamiclinechart.pro deleted file mode 100644 index 0e25690..0000000 --- a/examples/dynamiclinechart/dynamiclinechart.pro +++ /dev/null @@ -1,10 +0,0 @@ -!include( ../examples.pri ) { - error( "Couldn't find the examples.pri file!" ) -} -QT+=opengl -TARGET = dynamiclinechart -SOURCES += main.cpp -HEADERS += wavegenerator.h - - - diff --git a/examples/dynamiclinechart/main.cpp b/examples/dynamiclinechart/main.cpp deleted file mode 100644 index 424c692..0000000 --- a/examples/dynamiclinechart/main.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "wavegenerator.h" -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - - QMainWindow window; - - QLineSeries* series0 = new QLineSeries(); - QPen blue(Qt::blue); - blue.setWidth(3); - series0->setPen(blue); - QLineSeries* series1 = new QLineSeries(); - QPen red(Qt::red); - red.setWidth(3); - series1->setPen(red); - - WaveGenerator generator(series0,series1); - - QChartView* chartView = new QChartView(&window); - - chartView->setViewport( new QGLWidget() ); - chartView->setRenderHint(QPainter::Antialiasing); - chartView->setAnimationOptions(QChart::AllAnimations); - chartView->setChartTitle("This is wave generator buahha."); - chartView->addSeries(series0); - chartView->addSeries(series1); - - window.setCentralWidget(chartView); - window.resize(400, 300); - window.show(); - - return a.exec(); -} diff --git a/examples/dynamiclinechart/wavegenerator.h b/examples/dynamiclinechart/wavegenerator.h deleted file mode 100644 index 969654c..0000000 --- a/examples/dynamiclinechart/wavegenerator.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include - -QTCOMMERCIALCHART_USE_NAMESPACE - -#define PI 3.14159265358979 -static const int numPoints =100; - -class WaveGenerator: public QObject -{ - Q_OBJECT - -public: - WaveGenerator(QLineSeries* series1, QLineSeries* series2) : - m_series1(series1), - m_series2(series2), - m_wave(0), - m_step(2*PI/numPoints) - { - - QTime now = QTime::currentTime(); - qsrand((uint)now.msec()); - - int fluctuate = 100; - - for (qreal x = 0; x <= 2*PI; x+=m_step) { - series1->append(x, fabs(sin(x)*fluctuate)); - series2->append(x, fabs(cos(x)*fluctuate)); - } - - QObject::connect(&m_timer,SIGNAL(timeout()),this,SLOT(update())); - m_timer.setInterval(5000); - m_timer.start(); - - }; - -public slots: - void update() - { - int fluctuate; - - for (qreal i = 0, x = 0; x <= 2*PI; x+=m_step, i++) { - fluctuate = qrand() % 100; - m_series1->replace(x, fabs(sin(x)*fluctuate)); - fluctuate = qrand() % 100; - m_series2->replace(x, fabs(cos(x)*fluctuate)); - } - - } - -private: - QLineSeries* m_series1; - QLineSeries* m_series2; - int m_wave; - qreal m_step; - QTimer m_timer; -}; diff --git a/examples/examples.pro b/examples/examples.pro index f8f8c01..57c2c5e 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -2,12 +2,9 @@ TEMPLATE = subdirs SUBDIRS += \ areachart \ barchart \ - #chartview \ customchart \ - #dynamiclinechart \ ekgchart \ linechart \ - #multichart \ percentbarchart \ piechart \ piechartdrilldown \ diff --git a/examples/multichart/main.cpp b/examples/multichart/main.cpp deleted file mode 100644 index 2dbe763..0000000 --- a/examples/multichart/main.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include "multichartwidget.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - - MultiChartWidget *multi = new MultiChartWidget(); - - // Use the chart widget as the central widget - QMainWindow w; - w.resize(640, 480); - w.setCentralWidget(multi); - w.show(); - - return a.exec(); -} diff --git a/examples/multichart/multichart.pro b/examples/multichart/multichart.pro deleted file mode 100644 index 951f237..0000000 --- a/examples/multichart/multichart.pro +++ /dev/null @@ -1,12 +0,0 @@ -!include( ../examples.pri ) { - error( "Couldn't find the examples.pri file!" ) -} -TARGET = multichart -SOURCES += main.cpp \ - multichartwidget.cpp -HEADERS += \ - multichartwidget.h - - - - diff --git a/examples/multichart/multichartwidget.cpp b/examples/multichart/multichartwidget.cpp deleted file mode 100644 index 3c88dc4..0000000 --- a/examples/multichart/multichartwidget.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "multichartwidget.h" -#include -#include -#include -#include -#include - -QTCOMMERCIALCHART_USE_NAMESPACE - -MultiChartWidget::MultiChartWidget(QWidget *parent) : - QWidget(parent) -{ - QVBoxLayout *l = new QVBoxLayout(this); - - // Create chart 1 and add a simple pie series onto it - QChartView *chartView1 = new QChartView(); - l->addWidget(chartView1); - QPieSeries *pie = new QPieSeries(); - pie->append(1.1, "label1"); - pie->append(1.2, "label2"); - chartView1->addSeries(pie); - - // Create chart 2 and add a simple scatter series onto it - QChartView *chartView2 = new QChartView(); - l->addWidget(chartView2); - QScatterSeries *scatter = new QScatterSeries(); - *scatter << QPointF(0.5, 5.0) - << QPointF(1.0, 4.5) - << QPointF(1.0, 5.5) - << QPointF(1.5, 5.0) - << QPointF(2.0, 4.5) - << QPointF(2.0, 5.5) - << QPointF(2.5, 5.0); - chartView2->addSeries(scatter); -} diff --git a/examples/multichart/multichartwidget.h b/examples/multichart/multichartwidget.h deleted file mode 100644 index 8e234a6..0000000 --- a/examples/multichart/multichartwidget.h +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MULTICHARTWIDGET_H -#define MULTICHARTWIDGET_H - -#include - -class MultiChartWidget : public QWidget -{ - Q_OBJECT -public: - explicit MultiChartWidget(QWidget *parent = 0); - -signals: - -public slots: - -}; - -#endif // MULTICHARTWIDGET_H