summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJani Honkonen <jani.honkonen@digia.com>2012-08-29 10:27:00 +0300
committerJani Honkonen <jani.honkonen@digia.com>2012-08-29 10:28:11 +0300
commit7618c8da3444f1f699843ab0a5c0d5aec785dcef (patch)
treeaed2ce3dec547e59afd73b0bb1a7e87fe19c474e /doc
parente0460f4395dd09292ae73e49227f1962073a5fcc (diff)
Update donutbreakdown example docs
Diffstat (limited to 'doc')
-rw-r--r--doc/src/examples-donutbreakdown.qdoc47
-rw-r--r--doc/src/examples.qdoc3
2 files changed, 16 insertions, 34 deletions
diff --git a/doc/src/examples-donutbreakdown.qdoc b/doc/src/examples-donutbreakdown.qdoc
index 0d6e9732..a1753c02 100644
--- a/doc/src/examples-donutbreakdown.qdoc
+++ b/doc/src/examples-donutbreakdown.qdoc
@@ -5,48 +5,31 @@
This example shows how to use create a donut breakdown chart using QPieSeries API.
- Let's start by creating a QChartView instance and enabling the Antialiasing on it. Last line enables the animations of the chart.
+ Let's start by defining some data for the chart.
- \snippet ../examples/donutbreakdown/widget.cpp 1
+ \snippet ../examples/donutbreakdown/main.cpp 1
- PieSeries is used to present the general data.
+ Then we create a chart where we add the data. Note that this this is our own chart derived from QChart.
- \snippet ../examples/donutbreakdown/widget.cpp 2
+ \snippet ../examples/donutbreakdown/main.cpp 2
- Following block of code creates the slices for the mainData QPieSeries.
- Then for every created slice a new series is created that stores the detailed data.
- The details series is set to be a donut. Its size is adjusted so that it wraps around the mainData pie.
- Next two signals from the mainData pie's slices are connected. This is used to keep the mainData slices agligned with their respective details series.
+ Our own chart works so that in the constructor we create a main series
+ which aggregates the data provided by the breakdown series. This is the piechart in the center.
- \snippet ../examples/donutbreakdown/widget.cpp 3
+ \snippet ../examples/donutbreakdown/donutbreakdownchart.cpp 1
- Set the labels of the mainData to enabled and their postion to Outside.
- Then add the mainData and detailedData series to the chart.
+ When a breakdown series is added the data is used to create a slice in the main series and the
+ breakdown series itself is used to create a segment of a donut positioned so that it is aligned
+ with the corresponding slice in the main series.
- \snippet ../examples/donutbreakdown/widget.cpp 4
+ \snippet ../examples/donutbreakdown/donutbreakdownchart.cpp 2
- Finally the widget is placed in a layout used by the application.
+ Here's how the start and end angles for the donut segments are calculated.
- \snippet ../examples/donutbreakdown/widget.cpp 5
+ \snippet ../examples/donutbreakdown/donutbreakdownchart.cpp 3
- To show that the detailed data stays aligned with the main data every 2.5 sec. one of the slices is modified.
- It should be noted that int this example the mainData slices should not be modified directly as the change
- cannot be applied to the detailed slices without the extra knowledge on how the split looks like.
+ And now that we have our chart defined we can finally create a QChartView and show the chart.
- \snippet ../examples/donutbreakdown/widget.cpp 6
-
- When the mainData slice layout is changed the detailed data layout has to be modified accordingly.
- This is achived by setting the start and end angle of the detailed series.
-
- \snippet ../examples/donutbreakdown/widget.cpp 7
-
- Highlight slot selects a random slice for the modification.
- The slice is set to exploded to notify the user that its going to be changed.
- The actual data modification is delayed by 1 sec to give a user a chance to focus on the slice.
-
- Then the slice is modified. Respective mainData slice is modified as well to contain as the value the sum of the detailed series slices values.
- Finally the slice exploded state is set to false.
-
- \snippet ../examples/donutbreakdown/widget.cpp 8
+ \snippet ../examples/donutbreakdown/main.cpp 3
*/
diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc
index d264026a..1d4044cd 100644
--- a/doc/src/examples.qdoc
+++ b/doc/src/examples.qdoc
@@ -28,8 +28,7 @@
<li><a href="examples-piechart.html">Pie chart</a></li>
<li><a href="examples-donutchart.html">Donut chart</a></li>
<li><a href="examples-piechartdrilldown.html">Pie chart drilldown</a></li>
- <li><a href="examples-donut.html">Nested donuts chart</a></li>
- <li><a href="examples-donutbreakdown.html">Donut chart drilldown</a></li>
+ <li><a href="examples-donutbreakdown.html">Donut breakdown chart</a></li>
<li><a href="examples-presenterchart.html">Presenter chart</a></li>
<li><a href="examples-scatterchart.html">Scatter chart</a></li>
<li><a href="examples-scatterinteractions.html">Scatter interactions</a></li>