@@ -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 | 1 | CURRENTLY_BUILDING_COMPONENTS = "examples" |
|
2 | 2 | !include( ../config.pri ) { |
|
3 | 3 | error( "Couldn't find the config.pri file!" ) |
|
4 | 4 | } |
|
5 | 5 | |
|
6 | 6 | TEMPLATE = subdirs |
|
7 | 7 | SUBDIRS += \ |
|
8 | 8 | areachart \ |
|
9 | 9 | customchart \ |
|
10 | 10 | linechart \ |
|
11 | 11 | percentbarchart \ |
|
12 | 12 | piechart \ |
|
13 | 13 | piechartdrilldown \ |
|
14 | 14 | scatterchart \ |
|
15 | 15 | scatterinteractions \ |
|
16 | 16 | splinechart \ |
|
17 | 17 | stackedbarchart \ |
|
18 | 18 | stackedbarchartdrilldown \ |
|
19 | 19 | zoomlinechart \ |
|
20 | 20 | modeldata \ |
|
21 | 21 | barchart \ |
|
22 | 22 | legend \ |
|
23 | 23 | barmodelmapper \ |
|
24 | 24 | qmlpiechart \ |
|
25 | 25 | lineandbar \ |
|
26 | 26 | horizontalbarchart \ |
|
27 | 27 | horizontalstackedbarchart \ |
|
28 | 28 | horizontalpercentbarchart \ |
|
29 | 29 | donutbreakdown \ |
|
30 | 30 | temperaturerecords \ |
|
31 | 31 | donutchart \ |
|
32 | 32 | multiaxis \ |
|
33 | legendmarkers | |
|
33 | legendmarkers \ | |
|
34 | logvalueaxis | |
|
34 | 35 | |
|
35 | 36 | !linux-arm*: { |
|
36 | 37 | SUBDIRS += \ |
|
37 | 38 | datetimeaxis |
|
38 | 39 | } |
General Comments 0
You need to be logged in to leave comments.
Login now