##// END OF EJS Templates
Basic logvalueaxis example added
Marek Rosa -
r2365:b2dcbae22d23
parent child
Show More
@@ -0,0 +1,5
1 !include( ../examples.pri ) {
2 error( "Couldn't find the examples.pri file!" )
3 }
4 TARGET = logvalueaxis
5 SOURCES += main.cpp
@@ -0,0 +1,73
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
14 **
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
18 **
19 ****************************************************************************/
20
21 #include <QApplication>
22 #include <QMainWindow>
23 #include <QChartView>
24 #include <QLineSeries>
25 #include <QValueAxis>
26 #include <QLogValueAxis>
27
28 QTCOMMERCIALCHART_USE_NAMESPACE
29
30 int main(int argc, char *argv[])
31 {
32 QApplication a(argc, argv);
33
34 //![1]
35 QLineSeries *series = new QLineSeries();
36 *series << QPointF(1, 7) << QPointF(2, 73) << QPointF(3, 268) << QPointF(4, 17) << QPointF(5, 4325) << QPointF(6, 723);
37 //![1]
38
39 //![3]
40 QChart *chart = new QChart();
41 chart->addSeries(series);
42 chart->legend()->hide();
43 //![3]
44
45 //![4]
46 QValueAxis *axisX = new QValueAxis;
47 axisX->setTitleText("Data point");
48 axisX->setTickCount(6);
49 axisX->setLabelFormat("%i");
50 chart->addAxis(axisX, Qt::AlignBottom);
51 series->attachAxis(axisX);
52
53 QLogValueAxis *axisY = new QLogValueAxis;
54 axisY->setBase(2);
55 axisY->setTitleText("Values");
56 chart->addAxis(axisY, Qt::AlignLeft);
57 series->attachAxis(axisY);
58 //![4]
59
60 //![5]
61 QChartView *chartView = new QChartView(chart);
62 chartView->setRenderHint(QPainter::Antialiasing);
63 //![5]
64
65 //![6]
66 QMainWindow window;
67 window.setCentralWidget(chartView);
68 window.resize(800, 600);
69 window.show();
70 //![6]
71
72 return a.exec();
73 }
@@ -1,38 +1,39
1 CURRENTLY_BUILDING_COMPONENTS = "examples"
1 CURRENTLY_BUILDING_COMPONENTS = "examples"
2 !include( ../config.pri ) {
2 !include( ../config.pri ) {
3 error( "Couldn't find the config.pri file!" )
3 error( "Couldn't find the config.pri file!" )
4 }
4 }
5
5
6 TEMPLATE = subdirs
6 TEMPLATE = subdirs
7 SUBDIRS += \
7 SUBDIRS += \
8 areachart \
8 areachart \
9 customchart \
9 customchart \
10 linechart \
10 linechart \
11 percentbarchart \
11 percentbarchart \
12 piechart \
12 piechart \
13 piechartdrilldown \
13 piechartdrilldown \
14 scatterchart \
14 scatterchart \
15 scatterinteractions \
15 scatterinteractions \
16 splinechart \
16 splinechart \
17 stackedbarchart \
17 stackedbarchart \
18 stackedbarchartdrilldown \
18 stackedbarchartdrilldown \
19 zoomlinechart \
19 zoomlinechart \
20 modeldata \
20 modeldata \
21 barchart \
21 barchart \
22 legend \
22 legend \
23 barmodelmapper \
23 barmodelmapper \
24 qmlpiechart \
24 qmlpiechart \
25 lineandbar \
25 lineandbar \
26 horizontalbarchart \
26 horizontalbarchart \
27 horizontalstackedbarchart \
27 horizontalstackedbarchart \
28 horizontalpercentbarchart \
28 horizontalpercentbarchart \
29 donutbreakdown \
29 donutbreakdown \
30 temperaturerecords \
30 temperaturerecords \
31 donutchart \
31 donutchart \
32 multiaxis \
32 multiaxis \
33 legendmarkers
33 legendmarkers \
34 logvalueaxis
34
35
35 !linux-arm*: {
36 !linux-arm*: {
36 SUBDIRS += \
37 SUBDIRS += \
37 datetimeaxis
38 datetimeaxis
38 }
39 }
General Comments 0
You need to be logged in to leave comments. Login now