diff --git a/example/piechart/main.cpp b/example/piechart/main.cpp index 5a73bfc..95b7eec 100644 --- a/example/piechart/main.cpp +++ b/example/piechart/main.cpp @@ -26,8 +26,8 @@ int main(int argc, char *argv[]) //! [1] //! [2] - series->enableHoverHighlight(true); - series->enableClickExplodes(true); + series->setHoverHighlighting(); + series->setClickExplodes(); //! [2] window.setCentralWidget(chartView); diff --git a/src/piechart/qpieseries.cpp b/src/piechart/qpieseries.cpp index 8b3858a..7749348 100644 --- a/src/piechart/qpieseries.cpp +++ b/src/piechart/qpieseries.cpp @@ -106,18 +106,13 @@ bool QPieSeries::ChangeSet::isEmpty() const The pie series defines a pie chart which consists of pie slices which are QPieSlice objects. The slices can have any values as the QPieSeries will calculate its relative value to the sum of all slices. - The actual slice size (span) is determined by that relative value. + The actual slice size is determined by that relative value. - By default the pie is defined as full but it can be a partial pie. + By default the pie is defined as a full pie but it can be a partial pie. This can be done by setting a starting angle and angle span to the series. - Example on how to create a chart with pie series: - \snippet ../example/piechart/main.cpp 1 - - To help with the most common user intercation scenarions there some convenience functions. Specifically - exploding and higlighting: - \snippet ../example/piechart/main.cpp 2 - + To help with the most common user interaction scenarions there some convenience functions. + Like exploding a slice when clicked and higlighting when user hovers over a slice. */ /*! @@ -341,7 +336,7 @@ void QPieSeries::setLabelsVisible(bool visible) \sa QPieSlice::isExploded(), QPieSlice::setExploded(), QPieSlice::setExplodeDistance() */ -void QPieSeries::enableClickExplodes(bool enable) +void QPieSeries::setClickExplodes(bool enable) { if (enable) connect(this, SIGNAL(clicked(QPieSlice*)), this, SLOT(toggleExploded(QPieSlice*))); @@ -357,7 +352,7 @@ void QPieSeries::enableClickExplodes(bool enable) \sa QPieSlice::isExploded(), QPieSlice::setExploded() */ -void QPieSeries::enableHoverHighlight(bool enable) +void QPieSeries::setHoverHighlighting(bool enable) { if (enable) { connect(this, SIGNAL(hoverEnter(QPieSlice*)), this, SLOT(highlightOn(QPieSlice*))); diff --git a/src/piechart/qpieseries.h b/src/piechart/qpieseries.h index 9c22599..b1fbbc3 100644 --- a/src/piechart/qpieseries.h +++ b/src/piechart/qpieseries.h @@ -66,20 +66,17 @@ public: void clear(); int count() const; - QList slices() const; void setSizeFactor(qreal sizeFactor); qreal sizeFactor() const; - void setPosition(PiePosition position); PiePosition position() const; - void setSpan(qreal startAngle, qreal angleSpan); - void setLabelsVisible(bool visible); - void enableClickExplodes(bool enable); - void enableHoverHighlight(bool enable); + void setLabelsVisible(bool visible = true); + void setClickExplodes(bool enable = true); + void setHoverHighlighting(bool enable = true); // TODO: find slices? // QList findByValue(qreal value); diff --git a/src/piechart/qpieslice.cpp b/src/piechart/qpieslice.cpp index 5c0471e..600fe27 100644 --- a/src/piechart/qpieslice.cpp +++ b/src/piechart/qpieslice.cpp @@ -135,6 +135,7 @@ qreal QPieSlice::explodeDistance() const /*! Returns the percentage of this slice compared to all slices in the same series. + The returned value ranges from 0 to 1.0. Updated internally after the slice is added to the series. */ @@ -283,7 +284,7 @@ void QPieSlice::setLabelVisible(bool visible) /*! Sets this slice \a exploded. - \sa isExploded(), setExplodeDistance(), QPieSeries::enableClickExplodes() + \sa isExploded(), setExplodeDistance(), QPieSeries::setClickExplodes() */ void QPieSlice::setExploded(bool exploded) { @@ -296,7 +297,7 @@ void QPieSlice::setExploded(bool exploded) /*! Sets the explosion \a distance of this slice. It is the distance the slice is moved away from the pie center. - \sa explodeDistance(), isExploded(), QPieSeries::enableClickExplodes() + \sa explodeDistance(), isExploded(), QPieSeries::setClickExplodes() */ void QPieSlice::setExplodeDistance(qreal distance) {