##// END OF EJS Templates
horizontal barchart doc update
sauimone -
r1709:ced7cbe40d33
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,39
1 /*!
2 \example examples/horizontalbarchart
3 \title HorizontalBarChart Example
4 \subtitle
5
6 The example shows how to create a horizontal bar chart. HorizontalBarChart shows the data in sets as separate bars, which are grouped in categories.
7
8 \image examples_horizontalbarchart.png
9
10 Data that barchart visualizes, is defined by QBarSet instances. Here we create the sets and append data
11 to them.
12
13 \snippet ../examples/horizontalbarchart/main.cpp 1
14
15 We create the series and append the sets to it. The horizontalbarseries groups the data from sets to categories.
16 First value of each set are gropuped together at first category second value to second category and so on.
17
18 \snippet ../examples/horizontalbarchart/main.cpp 2
19
20 Then we create a chart and add the series to it.
21
22 \snippet ../examples/horizontalbarchart/main.cpp 3
23
24 We define the categories here and add them to QCategoriesAxis which we then set to be the x-axis of the chart.
25
26 \snippet ../examples/horizontalbarchart/main.cpp 4
27
28 And we also want to show the legend.
29
30 \snippet ../examples/horizontalbarchart/main.cpp 5
31
32 Finally we add the chart onto a view.
33
34 \snippet ../examples/horizontalbarchart/main.cpp 6
35
36 And it is ready to be shown in a window.
37
38 \snippet ../examples/horizontalbarchart/main.cpp 7
39 */
@@ -0,0 +1,17
1 /*!
2 \example examples/horizontalpercentbarchart
3 \title HorizontalPercentBarChart Example
4 \subtitle
5
6 The example shows how to create simple horizontal percent bar chart. Horizontal percent bar chart shows the data in set as percentage of
7 all sets, per category.
8
9 \image examples_horizontalpercentbarchart.png
10
11 Creating horizontal percent bar chart is just like creating a regular \l {BarChart Example} {bar chart}, except that for a
12 horizontal percent bar chart, we use QHorizontalPercentBarSeries api instead of QBarSeries. Also, in the
13 \l {BarChart Example} {bar chart} we used nice numbers algorithm to make the y axis numbering look better. With
14 percent bar chart there is no need for that, because the maximum y-axis value is always 100.
15
16 \snippet ../examples/horizontalpercentbarchart/main.cpp 3
17 */
@@ -0,0 +1,15
1 /*!
2 \example examples/horizontalstackedbarchart
3 \title HorizontalStackedBarChart Example
4 \subtitle
5
6 The example shows how to create simple stacked horizontal bar chart. Stacked bar chart shows the data in sets as bars that are
7 stacked on top of each other. The stacking is done per category.
8
9 \image examples_horizontalstackedbarchart.png
10
11 Creating stacked horizontal bar chart is just like creating a regular \l {BarChart Example} {bar chart}, except that for a
12 stacked horizontal bar chart, we use QHorizontalStackedBarSeries api instead of QBarSeries.
13
14 \snippet ../examples/horizontalstackedbarchart/main.cpp 3
15 */
@@ -77,6 +77,9
77 <li><a href="qstackedbarseries.html">QStackedBarSeries</a></li>
77 <li><a href="qstackedbarseries.html">QStackedBarSeries</a></li>
78 <li><a href="qhbarmodelmapper.html">QHBarModelMapper</a></li>
78 <li><a href="qhbarmodelmapper.html">QHBarModelMapper</a></li>
79 <li><a href="qvbarmodelmapper.html">QVBarModelMapper</a></li>
79 <li><a href="qvbarmodelmapper.html">QVBarModelMapper</a></li>
80 <li><a href="qhorizontalbarseries.html">QHorizontalBarSeries</a></li>
81 <li><a href="qhorizontalstackedbarseries.html">QHorizontalStackedBarSeries</a></li>
82 <li><a href="qhorizontalpercentbarseries.html">QHorizontalPercentBarSeries</a></li>
80 </ul>
83 </ul>
81 </td>
84 </td>
82 </tr>
85 </tr>
@@ -16,6 +16,9
16 <li><a href="examples-areachart.html">Area chart</a></li>
16 <li><a href="examples-areachart.html">Area chart</a></li>
17 <li><a href="examples-barchart.html">Bar chart</a></li>
17 <li><a href="examples-barchart.html">Bar chart</a></li>
18 <li><a href="examples-customchart.html">Custom chart</a></li>
18 <li><a href="examples-customchart.html">Custom chart</a></li>
19 <li><a href="examples-horizontalbarchart.html">Horizontal bar chart</a></li>
20 <li><a href="examples-horizontalstackedbarchart.html">Horizontal stacked bar chart</a></li>
21 <li><a href="examples-horizontalpercentbarchart.html">Horizontal percent bar chart</a></li>
19 <li><a href="examples-legend.html">Legend</a></li>
22 <li><a href="examples-legend.html">Legend</a></li>
20 <li><a href="examples-linechart.html">Line chart</a></li>
23 <li><a href="examples-linechart.html">Line chart</a></li>
21 <li><a href="examples-lineandbar.html">Line and barchart</a></li>
24 <li><a href="examples-lineandbar.html">Line and barchart</a></li>
@@ -30,6 +30,35
30
30
31 QTCOMMERCIALCHART_BEGIN_NAMESPACE
31 QTCOMMERCIALCHART_BEGIN_NAMESPACE
32
32
33 /*!
34 \class QHorizontalBarSeries
35 \brief Series for creating horizontal bar chart
36 \mainclass
37
38 QHorizontalBarSeries represents a series of data shown as bars. The purpose of this class is to draw bars
39 as groups, where bars in same category are grouped next to each other. QHorizontalBarSeries groups the data
40 from sets to categories, which are defined by a QStringList.
41
42 See the \l {HorizontalBarChart Example} {horizontal bar chart example} to learn how to create a horizontal bar chart.
43 \image examples_horizontalbarchart.png
44
45 \sa QBarSet, QBarSeries, QPercentBarSeries, QAbstractBarSeries, QStackedBarSeries, QHorizontalStackedBarSeries, QHorizontalPercentBarSeries
46 */
47 /*
48 // TODO:
49 \qmlclass Horizontal QHorizontalBarSeries
50 \inherits AbstractBarSeries
51
52 The following QML shows how to create a simple grouped bar chart:
53 \snippet ../demos/qmlchart/qml/qmlchart/View6.qml 1
54 \beginfloatleft
55 \image demos_qmlchart6.png
56 \endfloat
57 \clearfloat
58 */
59
60
61
33 QHorizontalBarSeries::QHorizontalBarSeries(QObject *parent) :
62 QHorizontalBarSeries::QHorizontalBarSeries(QObject *parent) :
34 QAbstractBarSeries(*new QHorizontalBarSeriesPrivate(this), parent)
63 QAbstractBarSeries(*new QHorizontalBarSeriesPrivate(this), parent)
35 {
64 {
@@ -56,7 +56,6 Chart* QHorizontalPercentBarSeriesPrivate::createGraphics(ChartPresenter* presen
56 return bar;
56 return bar;
57 }
57 }
58
58
59
60 #include "moc_qhorizontalpercentbarseries.cpp"
59 #include "moc_qhorizontalpercentbarseries.cpp"
61
60
62 QTCOMMERCIALCHART_END_NAMESPACE
61 QTCOMMERCIALCHART_END_NAMESPACE
@@ -58,7 +58,7 public:
58 QList<LegendMarker*> createLegendMarker(QLegend* legend);
58 QList<LegendMarker*> createLegendMarker(QLegend* legend);
59
59
60 void initializeAxis(QAbstractAxis* axis);
60 void initializeAxis(QAbstractAxis* axis);
61 QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const;
61 virtual QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const;
62
62
63 bool append(QBarSet *set);
63 bool append(QBarSet *set);
64 bool remove(QBarSet *set);
64 bool remove(QBarSet *set);
@@ -52,6 +52,9 QTCOMMERCIALCHART_BEGIN_NAMESPACE
52 \value SeriesTypePie
52 \value SeriesTypePie
53 \value SeriesTypeScatter
53 \value SeriesTypeScatter
54 \value SeriesTypeSpline
54 \value SeriesTypeSpline
55 \value SeriesTypeHorizontalBar
56 \value SeriesTypeHorizontalStackedBar
57 \value SeriesTypeHorizontalPercentBar
55 */
58 */
56
59
57 /*!
60 /*!
General Comments 0
You need to be logged in to leave comments. Login now