From 570404538427a02ae406bed47433d58ceefce32c 2012-09-05 09:15:16 From: Marek Rosa Date: 2012-09-05 09:15:16 Subject: [PATCH] Nesteddonuts chart docs updated --- diff --git a/demos/nesteddonuts/widget.cpp b/demos/nesteddonuts/widget.cpp index 0b02eb4..2dc8147 100644 --- a/demos/nesteddonuts/widget.cpp +++ b/demos/nesteddonuts/widget.cpp @@ -38,10 +38,10 @@ Widget::Widget(QWidget *parent) //! [1] QChartView *chartView = new QChartView; chartView->setRenderHint(QPainter::Antialiasing); - QChart *chart = chartView->chart(); - chart->setAnimationOptions(QChart::AllAnimations); + QChart *chart = chartView->chart(); chart->legend()->setVisible(false); chart->setTitle("Nested donuts demo"); + chart->setAnimationOptions(QChart::AllAnimations); //! [1] //! [2] diff --git a/doc/src/demos-nesteddonuts.qdoc b/doc/src/demos-nesteddonuts.qdoc index b037193..e18ba49 100644 --- a/doc/src/demos-nesteddonuts.qdoc +++ b/doc/src/demos-nesteddonuts.qdoc @@ -6,7 +6,8 @@ This example shows how to use create a nested donuts chart using QPieSeries API. \image demos_nesteddonuts.png - 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 creating a QChartView instance and enabling the Antialiasing on it. QChart object is then obtained from the QChartView instance. + The legend is disabled and the title of the chart is set. Last line enables the animations of the chart. \snippet ../demos/nesteddonuts/widget.cpp 1 @@ -16,7 +17,7 @@ \snippet ../demos/nesteddonuts/widget.cpp 2 Following block of code defines the individual donuts and their slices. First new QPieSeries object is created. - Callign setDonut() changes pie into a donut. The number of slices in each donut is randomized. + The number of slices in each donut is randomized. The internal for loop creates the slices with a random value and label same as the value. Next the label of the slice is set to be visible and its color is set to white. To make the example more interesting the hovered signal of the slice is connected to widget's slot which inner workings are explained later. @@ -40,7 +41,7 @@ The earlier mentioned explodeSlice slot code is provided below. If the slice is set to exploded then stop the timer that controls the donuts rotation. - Then the slice's start and end agles are obtained from the slice. + Then the slice's start and end angles are obtained from the slice. To highlight the selected slice all the other donuts that lie outward from the one that contains the selected slice have their start and end angles modified so that they wouldn't "block" the way for the hightlighted slice. If the slice is no longer selected return to the original state.