summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorMarek Rosa <marek.rosa@digia.com>2012-11-23 14:23:51 +0200
committerMichal Klocek <Michal.Klocek@digia.com>2012-11-26 14:58:47 +0200
commit5dd68c268a201cae46e1cf6c1ae019bc36b521d4 (patch)
treee0f6bba739c943ce08f531f15b421100bfd1667e /demos
parent75ed5c9858506bea31a772cf7d7fa8edd8037e45 (diff)
ChartViewer: added domain charts
Diffstat (limited to 'demos')
-rw-r--r--demos/chartviewer/charts/charts.pri17
-rw-r--r--demos/chartviewer/charts/domain/barlogx.cpp67
-rw-r--r--demos/chartviewer/charts/domain/barlogy.cpp67
-rw-r--r--demos/chartviewer/charts/domain/barpercentlogx.cpp67
-rw-r--r--demos/chartviewer/charts/domain/barpercentlogy.cpp67
-rw-r--r--demos/chartviewer/charts/domain/barstackedlogx.cpp67
-rw-r--r--demos/chartviewer/charts/domain/barstackedlogy.cpp67
-rw-r--r--demos/chartviewer/charts/domain/linelogxlogy.cpp62
-rw-r--r--demos/chartviewer/charts/domain/linelogxy.cpp62
-rw-r--r--demos/chartviewer/charts/domain/linexlogy.cpp62
-rw-r--r--demos/chartviewer/charts/domain/scatterlogxlogy.cpp62
-rw-r--r--demos/chartviewer/charts/domain/scatterlogxy.cpp62
-rw-r--r--demos/chartviewer/charts/domain/scatterxlogy.cpp62
-rw-r--r--demos/chartviewer/charts/domain/splinelogxlogy.cpp62
-rw-r--r--demos/chartviewer/charts/domain/splinelogxy.cpp62
-rw-r--r--demos/chartviewer/charts/domain/splinexlogy.cpp62
-rw-r--r--demos/chartviewer/model.h2
17 files changed, 977 insertions, 2 deletions
diff --git a/demos/chartviewer/charts/charts.pri b/demos/chartviewer/charts/charts.pri
index 13321efa..5bef427f 100644
--- a/demos/chartviewer/charts/charts.pri
+++ b/demos/chartviewer/charts/charts.pri
@@ -27,7 +27,22 @@ SOURCES += \
$$PWD/multiaxis/multivalueaxis3.cpp \
$$PWD/multiaxis/multivalueaxis4.cpp \
$$PWD/multiaxis/multivaluebaraxis.cpp \
- $$PWD/size/sizecharts.cpp
+ $$PWD/size/sizecharts.cpp \
+ $$PWD/domain/barlogy.cpp \
+ $$PWD/domain/barlogx.cpp \
+ $$PWD/domain/barstackedlogy.cpp \
+ $$PWD/domain/barstackedlogx.cpp \
+ $$PWD/domain/barpercentlogy.cpp \
+ $$PWD/domain/barpercentlogx.cpp \
+ $$PWD/domain/linelogxlogy.cpp \
+ $$PWD/domain/linelogxy.cpp \
+ $$PWD/domain/linexlogy.cpp \
+ $$PWD/domain/splinelogxlogy.cpp \
+ $$PWD/domain/splinelogxy.cpp \
+ $$PWD/domain/splinexlogy.cpp \
+ $$PWD/domain/scatterlogxlogy.cpp \
+ $$PWD/domain/scatterlogxy.cpp \
+ $$PWD/domain/scatterxlogy.cpp
!linux-arm*: {
SOURCES += \
diff --git a/demos/chartviewer/charts/domain/barlogx.cpp b/demos/chartviewer/charts/domain/barlogx.cpp
new file mode 100644
index 00000000..efb4c2cb
--- /dev/null
+++ b/demos/chartviewer/charts/domain/barlogx.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qhorizontalbarseries.h"
+#include "qbarset.h"
+#include "qlogvalueaxis.h"
+#include "qbarcategoryaxis.h"
+
+class BarLogX: public Chart
+{
+public:
+ QString name() { return "Horizontal Bar"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return "Horizontal Log"; }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Bar: Log X, BarCateogry Y");
+
+ QString name("Series ");
+ QHorizontalBarSeries *series = new QHorizontalBarSeries(chart);
+ QLogValueAxis *logvalueaxis = new QLogValueAxis();
+ logvalueaxis->setBase(2);
+ QBarCategoryAxis *barcategory = new QBarCategoryAxis();
+ for (int i(0); i < table.count(); i++) {
+ QBarSet *set = new QBarSet("Bar set " + QString::number(i));
+ foreach (Data data, table[i])
+ *set << data.first.y();
+ series->append(set);
+ }
+ chart->addSeries(series);
+
+ int count = series->barSets().first()->count();
+
+
+ for (int i = 0; i < count; i++) {
+ barcategory->append("BarSet " + QString::number(i));
+ }
+
+ chart->setAxisX(logvalueaxis, series);
+ chart->setAxisY(barcategory, series);
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(BarLogX);
diff --git a/demos/chartviewer/charts/domain/barlogy.cpp b/demos/chartviewer/charts/domain/barlogy.cpp
new file mode 100644
index 00000000..a8d01a74
--- /dev/null
+++ b/demos/chartviewer/charts/domain/barlogy.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qbarseries.h"
+#include "qbarset.h"
+#include "qlogvalueaxis.h"
+#include "qbarcategoryaxis.h"
+
+class BarLogY: public Chart
+{
+public:
+ QString name() { return "Bar"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return "Vertical Log"; }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Bar: BarCateogry X, Log Y");
+
+ QString name("Series ");
+ QBarSeries *series = new QBarSeries(chart);
+ QLogValueAxis *logvalueaxis = new QLogValueAxis();
+ logvalueaxis->setBase(2);
+ QBarCategoryAxis *barcategory = new QBarCategoryAxis();
+ for (int i(0); i < table.count(); i++) {
+ QBarSet *set = new QBarSet("Bar set " + QString::number(i));
+ foreach (Data data, table[i])
+ *set << data.first.y();
+ series->append(set);
+ }
+ chart->addSeries(series);
+
+ int count = series->barSets().first()->count();
+
+
+ for (int i = 0; i < count; i++) {
+ barcategory->append("BarSet " + QString::number(i));
+ }
+
+ chart->setAxisY(logvalueaxis, series);
+ chart->setAxisX(barcategory, series);
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(BarLogY);
diff --git a/demos/chartviewer/charts/domain/barpercentlogx.cpp b/demos/chartviewer/charts/domain/barpercentlogx.cpp
new file mode 100644
index 00000000..9bcf2490
--- /dev/null
+++ b/demos/chartviewer/charts/domain/barpercentlogx.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qhorizontalpercentbarseries.h"
+#include "qbarset.h"
+#include "qlogvalueaxis.h"
+#include "qbarcategoryaxis.h"
+
+class BarPercentLogX: public Chart
+{
+public:
+ QString name() { return "Horizontal PercentBar"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return "Horizontal Log"; }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("PercentBar: Log X, BarCateogry Y");
+
+ QString name("Series ");
+ QHorizontalPercentBarSeries *series = new QHorizontalPercentBarSeries(chart);
+ QLogValueAxis *logvalueaxis = new QLogValueAxis();
+ logvalueaxis->setBase(2);
+ QBarCategoryAxis *barcategory = new QBarCategoryAxis();
+ for (int i(0); i < table.count(); i++) {
+ QBarSet *set = new QBarSet("Bar set " + QString::number(i));
+ foreach (Data data, table[i])
+ *set << data.first.y();
+ series->append(set);
+ }
+ chart->addSeries(series);
+
+ int count = series->barSets().first()->count();
+
+
+ for (int i = 0; i < count; i++) {
+ barcategory->append("BarSet " + QString::number(i));
+ }
+
+ chart->setAxisX(logvalueaxis, series);
+ chart->setAxisY(barcategory, series);
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(BarPercentLogX);
diff --git a/demos/chartviewer/charts/domain/barpercentlogy.cpp b/demos/chartviewer/charts/domain/barpercentlogy.cpp
new file mode 100644
index 00000000..f771369b
--- /dev/null
+++ b/demos/chartviewer/charts/domain/barpercentlogy.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qpercentbarseries.h"
+#include "qbarset.h"
+#include "qlogvalueaxis.h"
+#include "qbarcategoryaxis.h"
+
+class BarPercentLogY: public Chart
+{
+public:
+ QString name() { return "PercentBar"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return "Vertical Log"; }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("PercentBar: BarCateogry X, Log Y");
+
+ QString name("Series ");
+ QPercentBarSeries *series = new QPercentBarSeries(chart);
+ QLogValueAxis *logvalueaxis = new QLogValueAxis();
+ logvalueaxis->setBase(2);
+ QBarCategoryAxis *barcategory = new QBarCategoryAxis();
+ for (int i(0); i < table.count(); i++) {
+ QBarSet *set = new QBarSet("Bar set " + QString::number(i));
+ foreach (Data data, table[i])
+ *set << data.first.y();
+ series->append(set);
+ }
+ chart->addSeries(series);
+
+ int count = series->barSets().first()->count();
+
+
+ for (int i = 0; i < count; i++) {
+ barcategory->append("BarSet " + QString::number(i));
+ }
+
+ chart->setAxisY(logvalueaxis, series);
+ chart->setAxisX(barcategory, series);
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(BarPercentLogY);
diff --git a/demos/chartviewer/charts/domain/barstackedlogx.cpp b/demos/chartviewer/charts/domain/barstackedlogx.cpp
new file mode 100644
index 00000000..fff7dbc3
--- /dev/null
+++ b/demos/chartviewer/charts/domain/barstackedlogx.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qhorizontalstackedbarseries.h"
+#include "qbarset.h"
+#include "qlogvalueaxis.h"
+#include "qbarcategoryaxis.h"
+
+class BarStackedLogX: public Chart
+{
+public:
+ QString name() { return "Horizontal StackedBar"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return "Horizontal Log"; }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("StackedBar: Log X, BarCateogry Y");
+
+ QString name("Series ");
+ QHorizontalStackedBarSeries *series = new QHorizontalStackedBarSeries(chart);
+ QLogValueAxis *logvalueaxis = new QLogValueAxis();
+ logvalueaxis->setBase(2);
+ QBarCategoryAxis *barcategory = new QBarCategoryAxis();
+ for (int i(0); i < table.count(); i++) {
+ QBarSet *set = new QBarSet("Bar set " + QString::number(i));
+ foreach (Data data, table[i])
+ *set << data.first.y();
+ series->append(set);
+ }
+ chart->addSeries(series);
+
+ int count = series->barSets().first()->count();
+
+
+ for (int i = 0; i < count; i++) {
+ barcategory->append("BarSet " + QString::number(i));
+ }
+
+ chart->setAxisX(logvalueaxis, series);
+ chart->setAxisY(barcategory, series);
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(BarStackedLogX);
diff --git a/demos/chartviewer/charts/domain/barstackedlogy.cpp b/demos/chartviewer/charts/domain/barstackedlogy.cpp
new file mode 100644
index 00000000..d5041182
--- /dev/null
+++ b/demos/chartviewer/charts/domain/barstackedlogy.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qstackedbarseries.h"
+#include "qbarset.h"
+#include "qlogvalueaxis.h"
+#include "qbarcategoryaxis.h"
+
+class BarStackedLogY: public Chart
+{
+public:
+ QString name() { return "StackedBar"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return "Vertical Log"; }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("StackedBar: BarCateogry X, Log Y");
+
+ QString name("Series ");
+ QStackedBarSeries *series = new QStackedBarSeries(chart);
+ QLogValueAxis *logvalueaxis = new QLogValueAxis();
+ logvalueaxis->setBase(2);
+ QBarCategoryAxis *barcategory = new QBarCategoryAxis();
+ for (int i(0); i < table.count(); i++) {
+ QBarSet *set = new QBarSet("Bar set " + QString::number(i));
+ foreach (Data data, table[i])
+ *set << data.first.y();
+ series->append(set);
+ }
+ chart->addSeries(series);
+
+ int count = series->barSets().first()->count();
+
+
+ for (int i = 0; i < count; i++) {
+ barcategory->append("BarSet " + QString::number(i));
+ }
+
+ chart->setAxisY(logvalueaxis, series);
+ chart->setAxisX(barcategory, series);
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(BarStackedLogY);
diff --git a/demos/chartviewer/charts/domain/linelogxlogy.cpp b/demos/chartviewer/charts/domain/linelogxlogy.cpp
new file mode 100644
index 00000000..12b817a7
--- /dev/null
+++ b/demos/chartviewer/charts/domain/linelogxlogy.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qlineseries.h"
+#include "qlogvalueaxis.h"
+
+class LineLogXLogY: public Chart
+{
+public:
+ QString name() { return "Line LogX LogY"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return QObject::tr("Both Log"); }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Line: Log X, Log Y");
+
+ QString name("Series ");
+ int nameIndex = 0;
+ foreach (DataList list, table) {
+ QLineSeries *series = new QLineSeries(chart);
+ foreach (Data data, list)
+ series->append(data.first);
+ series->setName(name + QString::number(nameIndex));
+ nameIndex++;
+ chart->addSeries(series);
+ }
+
+ QLogValueAxis *axisX= new QLogValueAxis();
+ axisX->setBase(1.2);
+ QLogValueAxis *axisY= new QLogValueAxis();
+ axisY->setBase(2);
+ foreach (QAbstractSeries *series, chart->series()) {
+ chart->setAxisX(axisX, series);
+ chart->setAxisY(axisY, series);
+ }
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(LineLogXLogY);
diff --git a/demos/chartviewer/charts/domain/linelogxy.cpp b/demos/chartviewer/charts/domain/linelogxy.cpp
new file mode 100644
index 00000000..157af6d9
--- /dev/null
+++ b/demos/chartviewer/charts/domain/linelogxy.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qlineseries.h"
+#include "qlogvalueaxis.h"
+#include "qvalueaxis.h"
+
+class LineLogXY: public Chart
+{
+public:
+ QString name() { return "Line LogX Y"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return QObject::tr("Both Log"); }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Line: Log X, Y");
+
+ QString name("Series ");
+ int nameIndex = 0;
+ foreach (DataList list, table) {
+ QLineSeries *series = new QLineSeries(chart);
+ foreach (Data data, list)
+ series->append(data.first);
+ series->setName(name + QString::number(nameIndex));
+ nameIndex++;
+ chart->addSeries(series);
+ }
+
+ QLogValueAxis *axisX= new QLogValueAxis();
+ axisX->setBase(1.2);
+ QValueAxis *axisY= new QValueAxis();
+ foreach (QAbstractSeries *series, chart->series()) {
+ chart->setAxisX(axisX, series);
+ chart->setAxisY(axisY, series);
+ }
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(LineLogXY);
diff --git a/demos/chartviewer/charts/domain/linexlogy.cpp b/demos/chartviewer/charts/domain/linexlogy.cpp
new file mode 100644
index 00000000..468f71fa
--- /dev/null
+++ b/demos/chartviewer/charts/domain/linexlogy.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qlineseries.h"
+#include "qlogvalueaxis.h"
+#include "qvalueaxis.h"
+
+class LineXLogY: public Chart
+{
+public:
+ QString name() { return "Line X LogY"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return QObject::tr("Both Log"); }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Line: X, Log Y");
+
+ QString name("Series ");
+ int nameIndex = 0;
+ foreach (DataList list, table) {
+ QLineSeries *series = new QLineSeries(chart);
+ foreach (Data data, list)
+ series->append(data.first);
+ series->setName(name + QString::number(nameIndex));
+ nameIndex++;
+ chart->addSeries(series);
+ }
+
+ QValueAxis *axisX= new QValueAxis();
+ QLogValueAxis *axisY= new QLogValueAxis();
+ axisY->setBase(2);
+ foreach (QAbstractSeries *series, chart->series()) {
+ chart->setAxisX(axisX, series);
+ chart->setAxisY(axisY, series);
+ }
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(LineXLogY);
diff --git a/demos/chartviewer/charts/domain/scatterlogxlogy.cpp b/demos/chartviewer/charts/domain/scatterlogxlogy.cpp
new file mode 100644
index 00000000..2727315d
--- /dev/null
+++ b/demos/chartviewer/charts/domain/scatterlogxlogy.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qscatterseries.h"
+#include "qlogvalueaxis.h"
+
+class ScatterLogXLogY: public Chart
+{
+public:
+ QString name() { return "Scatter LogX LogY"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return QObject::tr("Both Log"); }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Scatter: Log X, Log Y");
+
+ QString name("Series ");
+ int nameIndex = 0;
+ foreach (DataList list, table) {
+ QScatterSeries *series = new QScatterSeries(chart);
+ foreach (Data data, list)
+ series->append(data.first);
+ series->setName(name + QString::number(nameIndex));
+ nameIndex++;
+ chart->addSeries(series);
+ }
+
+ QLogValueAxis *axisX= new QLogValueAxis();
+ axisX->setBase(1.2);
+ QLogValueAxis *axisY= new QLogValueAxis();
+ axisY->setBase(2);
+ foreach (QAbstractSeries *series, chart->series()) {
+ chart->setAxisX(axisX, series);
+ chart->setAxisY(axisY, series);
+ }
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(ScatterLogXLogY);
diff --git a/demos/chartviewer/charts/domain/scatterlogxy.cpp b/demos/chartviewer/charts/domain/scatterlogxy.cpp
new file mode 100644
index 00000000..d48e9e28
--- /dev/null
+++ b/demos/chartviewer/charts/domain/scatterlogxy.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qscatterseries.h"
+#include "qlogvalueaxis.h"
+#include "qvalueaxis.h"
+
+class ScatterLogXY: public Chart
+{
+public:
+ QString name() { return "Scatter LogX Y"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return QObject::tr("Both Log"); }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Scatter: Log X, Y");
+
+ QString name("Series ");
+ int nameIndex = 0;
+ foreach (DataList list, table) {
+ QScatterSeries *series = new QScatterSeries(chart);
+ foreach (Data data, list)
+ series->append(data.first);
+ series->setName(name + QString::number(nameIndex));
+ nameIndex++;
+ chart->addSeries(series);
+ }
+
+ QLogValueAxis *axisX= new QLogValueAxis();
+ axisX->setBase(1.2);
+ QValueAxis *axisY= new QValueAxis();
+ foreach (QAbstractSeries *series, chart->series()) {
+ chart->setAxisX(axisX, series);
+ chart->setAxisY(axisY, series);
+ }
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(ScatterLogXY);
diff --git a/demos/chartviewer/charts/domain/scatterxlogy.cpp b/demos/chartviewer/charts/domain/scatterxlogy.cpp
new file mode 100644
index 00000000..c05a8874
--- /dev/null
+++ b/demos/chartviewer/charts/domain/scatterxlogy.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qscatterseries.h"
+#include "qlogvalueaxis.h"
+#include "qvalueaxis.h"
+
+class ScatterXLogY: public Chart
+{
+public:
+ QString name() { return "Scatter X LogY"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return QObject::tr("Both Log"); }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Scatter: X, Log Y");
+
+ QString name("Series ");
+ int nameIndex = 0;
+ foreach (DataList list, table) {
+ QScatterSeries *series = new QScatterSeries(chart);
+ foreach (Data data, list)
+ series->append(data.first);
+ series->setName(name + QString::number(nameIndex));
+ nameIndex++;
+ chart->addSeries(series);
+ }
+
+ QValueAxis *axisX= new QValueAxis();
+ QLogValueAxis *axisY= new QLogValueAxis();
+ axisY->setBase(2);
+ foreach (QAbstractSeries *series, chart->series()) {
+ chart->setAxisX(axisX, series);
+ chart->setAxisY(axisY, series);
+ }
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(ScatterXLogY);
diff --git a/demos/chartviewer/charts/domain/splinelogxlogy.cpp b/demos/chartviewer/charts/domain/splinelogxlogy.cpp
new file mode 100644
index 00000000..a9b156bd
--- /dev/null
+++ b/demos/chartviewer/charts/domain/splinelogxlogy.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qsplineseries.h"
+#include "qlogvalueaxis.h"
+
+class SplineLogXLogY: public Chart
+{
+public:
+ QString name() { return "Spline LogX LogY"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return QObject::tr("Both Log"); }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Spline: Log X, Log Y");
+
+ QString name("Series ");
+ int nameIndex = 0;
+ foreach (DataList list, table) {
+ QSplineSeries *series = new QSplineSeries(chart);
+ foreach (Data data, list)
+ series->append(data.first);
+ series->setName(name + QString::number(nameIndex));
+ nameIndex++;
+ chart->addSeries(series);
+ }
+
+ QLogValueAxis *axisX= new QLogValueAxis();
+ axisX->setBase(1.2);
+ QLogValueAxis *axisY= new QLogValueAxis();
+ axisY->setBase(2);
+ foreach (QAbstractSeries *series, chart->series()) {
+ chart->setAxisX(axisX, series);
+ chart->setAxisY(axisY, series);
+ }
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(SplineLogXLogY);
diff --git a/demos/chartviewer/charts/domain/splinelogxy.cpp b/demos/chartviewer/charts/domain/splinelogxy.cpp
new file mode 100644
index 00000000..1450a3f4
--- /dev/null
+++ b/demos/chartviewer/charts/domain/splinelogxy.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qsplineseries.h"
+#include "qlogvalueaxis.h"
+#include "qvalueaxis.h"
+
+class SplineLogXY: public Chart
+{
+public:
+ QString name() { return "Spline LogX Y"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return QObject::tr("Both Log"); }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Spline: Log X, Y");
+
+ QString name("Series ");
+ int nameIndex = 0;
+ foreach (DataList list, table) {
+ QSplineSeries *series = new QSplineSeries(chart);
+ foreach (Data data, list)
+ series->append(data.first);
+ series->setName(name + QString::number(nameIndex));
+ nameIndex++;
+ chart->addSeries(series);
+ }
+
+ QLogValueAxis *axisX= new QLogValueAxis();
+ axisX->setBase(1.2);
+ QValueAxis *axisY= new QValueAxis();
+ foreach (QAbstractSeries *series, chart->series()) {
+ chart->setAxisX(axisX, series);
+ chart->setAxisY(axisY, series);
+ }
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(SplineLogXY);
diff --git a/demos/chartviewer/charts/domain/splinexlogy.cpp b/demos/chartviewer/charts/domain/splinexlogy.cpp
new file mode 100644
index 00000000..e1eaf4ca
--- /dev/null
+++ b/demos/chartviewer/charts/domain/splinexlogy.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 "charts.h"
+#include "qchart.h"
+#include "qsplineseries.h"
+#include "qlogvalueaxis.h"
+#include "qvalueaxis.h"
+
+class SplineXLogY: public Chart
+{
+public:
+ QString name() { return "Spline X LogY"; }
+ QString category() { return QObject::tr("Domain"); }
+ QString subCategory() { return QObject::tr("Both Log"); }
+
+ QChart *createChart(const DataTable &table)
+ {
+ QChart *chart = new QChart();
+ chart->setTitle("Spline: X, Log Y");
+
+ QString name("Series ");
+ int nameIndex = 0;
+ foreach (DataList list, table) {
+ QSplineSeries *series = new QSplineSeries(chart);
+ foreach (Data data, list)
+ series->append(data.first);
+ series->setName(name + QString::number(nameIndex));
+ nameIndex++;
+ chart->addSeries(series);
+ }
+
+ QValueAxis *axisX= new QValueAxis();
+ QLogValueAxis *axisY= new QLogValueAxis();
+ axisY->setBase(2);
+ foreach (QAbstractSeries *series, chart->series()) {
+ chart->setAxisX(axisX, series);
+ chart->setAxisY(axisY, series);
+ }
+
+ return chart;
+ }
+};
+
+DECLARE_CHART(SplineXLogY);
diff --git a/demos/chartviewer/model.h b/demos/chartviewer/model.h
index c1601446..2195b711 100644
--- a/demos/chartviewer/model.h
+++ b/demos/chartviewer/model.h
@@ -48,7 +48,7 @@ public:
// generate random data
for (int i(0); i < listCount; i++) {
DataList dataList;
- qreal yValue(0);
+ qreal yValue(0.1);
for (int j(0); j < valueCount; j++) {
yValue = yValue + (qreal)(qrand() % valueMax) / (qreal) valueCount;
QPointF value(