##// END OF EJS Templates
Updated API Classes page in docs
Marek Rosa -
r1368:eebcdd02f0a9
parent child
Show More
@@ -3,89 +3,99
3 \title QtCommercial Charts API
3 \title QtCommercial Charts API
4 \keyword All Classes
4 \keyword All Classes
5
5
6 Charts API is build on top of Qt Graphics View Framework. Charts can be displayed as QGraphicsWidget using QChart class. However
6 Charts API is build on top of Qt Graphics View Framework. Charts can be displayed as QGraphicsWidget using QChart class. However
7 there is also convenience class QChartView which is QWidget based. These lets quickly use QCharts as normal Qt widget.
7 there is also convenience class QChartView which is QWidget based. These lets quickly use QCharts as normal Qt widget.
8 The API supports following chart types:
8 The API supports following chart types:
9
9
10 \list
10 \list
11 \o area
11 \o area
12 \o line
12 \o line
13 \o bar
13 \o grouped bar
14 \o percent bar
14 \o percent bar
15 \o pie
15 \o pie
16 \o scatter
16 \o scatter
17 \o spline
17 \o spline
18 \o stacked bar
18 \o stacked bar
19 \endlist
19 \endlist
20
20
21
21
22 Each chart type is represented by QSeries derived class. To create given chart type users have to use instace of releted sereis class and add it to QChart/QChartView instance.
22 Each chart type is represented by QSeries derived class. To create given chart type users have to use instace of releted sereis class and add it to QChart/QChartView instance.
23 \code
23 \code
24 QLineSeries* series = new QLineSeries();
24 QLineSeries* series = new QLineSeries();
25 series->add(0, 6);
25 series->add(0, 6);
26 series->add(2, 4);
26 series->add(2, 4);
27 ...
27 ...
28 chart->addSeries(series);
28 chartView->chart()->addSeries(series);
29 \endcode
29 \endcode
30
30
31 \raw HTML
31 \raw HTML
32 <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable">
32 <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable">
33 <tr>
33 <tr>
34 <th class="titleheader" width="33%">
34 <th class="titleheader" width="25%">
35 List of classes
35 Common
36 </th>
36 </th>
37 </tr>
37 <th class="titleheader" width="25%">
38 <tr>
38 XY type
39 <td valign="top">
39 </th>
40 <ul>
40 <th class="titleheader" width="25%">
41 <li><a href="qareaseries.html">QAreaSeries</a></li>
41 Pie type
42 <li><a href="qbarseries.html">QBarSeries</a></li>
42 </th>
43 <li><a href="qbarset.html">QBarSet</a></li>
43 <th class="titleheader" width="25%">
44 <li><a href="qchart.html">QChart</a></li>
44 Bar type
45 <li><a href="qaxis.html">QAxis</a></li>
45 </th>
46 <li><a href="qchartview.html">QChartView</a></li>
46 <th class="titleheader" width="25%">
47 <li><a href="qlineseries.html">QLineSeries</a></li>
47 Other files
48 <li><a href="qpercentbarseries.html">QPercentBarSeries</a></li>
49 <li><a href="qpieseries.html">QPieSeries</a></li>
50 <li><a href="qpieslice.html">QPieSlice</a></li>
51 <li><a href="qscatterseries.html">QScatterSeries</a></li>
52 <li><a href="qabstractseries.html">QAbstractSeries</a></li>
53 <li><a href="qsplineseries.html">QSplineSeries</a></li>
54 <li><a href="qstackedbarseries.html">QStackedBarSeries</a></li>
55 <li><a href="qxyseries.html">QXYSeries</a></li>
56 <li><a href="qlegend.html">QLegend</a></li>
57 <li><a href="qpiemodelmapper.html">QPieModelMapper</a></li>
58 <ul>
59 <li><a href="qhpiemodelmapper.html">QHPieModelMapper</a></li>
60 <li><a href="qvpiemodelmapper.html">QVPieModelMapper</a></li>
61 </ul>
62 <li><a href="qbarmodelmapper.html">QBarModelMapper</a></li>
63 <ul>
64 <li><a href="qhbarmodelmapper.html">QHBarModelMapper</a></li>
65 <li><a href="qvbarmodelmapper.html">QVBarModelMapper</a></li>
66 </ul>
67 <li><a href="qxymodelmapper.html">QXYModelMapper</a></li>
68 <ul>
69 <li><a href="qhxymodelmapper.html">QHXYModelMapper</a></li>
70 <li><a href="qvxymodelmapper.html">QVXYModelMapper</a></li>
71 </ul>
72 </ul>
73 </td>
74 </tr>
75 </table>
76
77 <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable">
78 <tr>
79 <th class="titleheader" width="33%">
80 Other files:
81 </th>
48 </th>
82 </tr>
49 </tr>
83 <tr>
50 <tr>
84 <td valign="top">
51 <td valign="top">
85 <ul>
52 <ul>
86 <li><a href="qchartglobal.html">QChartGlobal</a></li>
53 <li><a href="qchart.html">QChart</a></li>
87 </ul>
54 <li><a href="qaxis.html">QAxis</a></li>
88 </td>
55 <li><a href="qaxiscategories.html">QAxisCategories</a></li>
56 <li><a href="qchartview.html">QChartView</a></li>
57 <li><a href="qlegend.html">QLegend</a></li>
58 <li><a href="qabstractseries.html">QAbstractSeries</a></li>
59 <li><a href="qchartglobal.html">QChartGlobal</a></li>
60 </ul>
61 </td>
62 <td valign="top">
63 <ul>
64 <li><a href="qlineseries.html">QLineSeries</a></li>
65 <li><a href="qareaseries.html">QAreaSeries</a></li>
66 <li><a href="qscatterseries.html">QScatterSeries</a></li>
67 <li><a href="qsplineseries.html">QSplineSeries</a></li>
68 <li><a href="qxymodelmapper.html">QXYModelMapper</a></li>
69 <li><a href="qhxymodelmapper.html">QHXYModelMapper</a></li>
70 <li><a href="qvxymodelmapper.html">QVXYModelMapper</a></li>
71 </ul>
72 </td>
73 <td valign="top">
74 <ul>
75 <li><a href="qpieseries.html">QPieSeries</a></li>
76 <li><a href="qpieslice.html">QPieSlice</a></li>
77 <li><a href="qpiemodelmapper.html">QPieModelMapper</a></li>
78 <li><a href="qhpiemodelmapper.html">QHPieModelMapper</a></li>
79 <li><a href="qvpiemodelmapper.html">QVPieModelMapper</a></li>
80 </ul>
81 </td>
82 <td valign="top">
83 <ul>
84 <li><a href="qbarseries.html">QBarSeries</a></li>
85 <li><a href="qbarset.html">QBarSet</a></li>
86 <li><a href="qgroupedbarseries.html">QGroupedBarSeries</a></li>
87 <li><a href="qpercentbarseries.html">QPercentBarSeries</a></li>
88 <li><a href="qstackedbarseries.html">QStackedBarSeries</a></li>
89 <li><a href="qbarmodelmapper.html">QBarModelMapper</a></li>
90 <li><a href="qhbarmodelmapper.html">QHBarModelMapper</a></li>
91 <li><a href="qvbarmodelmapper.html">QVBarModelMapper</a></li>
92 </ul>
93 </td>
94 <td valign="top">
95 <ul>
96 <li><a href="qchartglobal.html">QChartGlobal</a></li>
97 </ul>
98 </td>
89 </tr>
99 </tr>
90 </table>
100 </table>
91
101
@@ -30,7 +30,7 CustomTableModel::CustomTableModel(QObject *parent) :
30 qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
30 qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
31
31
32 m_columnCount = 7;
32 m_columnCount = 7;
33 m_rowCount = 29;
33 m_rowCount = 10;
34
34
35 m_labels.append("Apples");
35 m_labels.append("Apples");
36 m_labels.append("Oranges");
36 m_labels.append("Oranges");
@@ -251,6 +251,14 void TableWidget::updateChartType(bool toggle)
251 // m_mapper->setFirst(3);
251 // m_mapper->setFirst(3);
252 // m_mapper->setCount(4);
252 // m_mapper->setCount(4);
253
253
254 QAxisCategories* xCategories = m_chart->axisX()->categories();
255 xCategories->insert(50, "Jeden");
256 xCategories->insert(100, "Dwa");
257 xCategories->insert(150, "Trzy");
258 xCategories->insert(200, "Cztery");
259 xCategories->insert(250, "Piec");
260 xCategories->insert(300, "szesc");
261
254 m_mapper = new QVXYModelMapper;
262 m_mapper = new QVXYModelMapper;
255 m_mapper->setModel(m_model);
263 m_mapper->setModel(m_model);
256 m_mapper->setSeries(m_series);
264 m_mapper->setSeries(m_series);
@@ -483,6 +491,19 void TableWidget::updateChartType(bool toggle)
483
491
484 m_barSeries = new QGroupedBarSeries();
492 m_barSeries = new QGroupedBarSeries();
485
493
494 // QAxisCategories* xCategories = m_chart->axisX()->categories();
495 // xCategories->insert(0, "Jeden");
496 // xCategories->insert(1, "Dwa");
497 // xCategories->insert(2, "Trzy");
498 // xCategories->insert(3, "Cztery");
499 // xCategories->insert(4, "Piec");
500 // xCategories->insert(5, "szesc");
501
502 QStringList categories;
503 categories << "June" << "July" << "August" << "September" << "October" << "November";
504
505 m_chart->axisX()->categories()->insert(categories);
506
486 int first = 3;
507 int first = 3;
487 int count = 6;
508 int count = 6;
488 m_barMapper = new QVBarModelMapper;
509 m_barMapper = new QVBarModelMapper;
@@ -495,10 +516,10 void TableWidget::updateChartType(bool toggle)
495 // barSeries->setModelMapper(mapper);
516 // barSeries->setModelMapper(mapper);
496 m_chart->addSeries(m_barSeries);
517 m_chart->addSeries(m_barSeries);
497
518
498 QStringList categories;
519 // QStringList categories;
499 categories << "June" << "July" << "August" << "September" << "October" << "November";
520 // categories << "June" << "July" << "August" << "September" << "October" << "November";
500
521
501 m_chart->axisX()->categories()->insert(categories);
522 // m_chart->axisX()->categories()->insert(categories);
502
523
503 QList<QBarSet*> barsets = m_barSeries->barSets();
524 QList<QBarSet*> barsets = m_barSeries->barSets();
504 for (int i = 0; i < barsets.count(); i++) {
525 for (int i = 0; i < barsets.count(); i++) {
General Comments 0
You need to be logged in to leave comments. Login now