From 232715f311f87d970af3224150a8687907c72071 2013-04-29 08:29:38 From: Miikka Heikkinen Date: 2013-04-29 08:29:38 Subject: [PATCH] Documentation updates Brought the documentation up to date and fixed a bunch of typos. Task-number: QTRD-1951 Change-Id: Id9274e911c314cea6ec8968433cf3c962baf5815 Reviewed-by: Tomi Korpipää --- diff --git a/src/areachart/qareaseries.cpp b/src/areachart/qareaseries.cpp index 9e9d1fc..e6feb36 100644 --- a/src/areachart/qareaseries.cpp +++ b/src/areachart/qareaseries.cpp @@ -69,12 +69,12 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \property QAreaSeries::lowerSeries The lower one of the two line series used to define are series boundaries. Note if - QAreaSeries was counstucted wihtout a\ lowerSeries this is null. + QAreaSeries was constructed without a\ lowerSeries this is null. */ /*! \qmlproperty LineSeries AreaSeries::lowerSeries The lower one of the two line series used to define are series boundaries. Note if - AreaSeries was counstucted wihtout a\ lowerSeries this is null. + AreaSeries was constructed without a\ lowerSeries this is null. */ /*! diff --git a/src/axis/barcategoryaxis/qbarcategoryaxis.cpp b/src/axis/barcategoryaxis/qbarcategoryaxis.cpp index 0dfbea1..c56d64c 100644 --- a/src/axis/barcategoryaxis/qbarcategoryaxis.cpp +++ b/src/axis/barcategoryaxis/qbarcategoryaxis.cpp @@ -290,7 +290,7 @@ void QBarCategoryAxis::insert(int index, const QString &category) } /*! - Replaces \a oldCategory with \a newCategory. If \a oldCategory does not exits on the axis nothing is done. + Replaces \a oldCategory with \a newCategory. If \a oldCategory does not exist on the axis nothing is done. A \a newCategory has to be valid QStrings and can not be duplicated. In case of replacing minimum or maximum category, minimum and maximum of axis is updated accordingly. */ diff --git a/src/axis/datetimeaxis/qdatetimeaxis.cpp b/src/axis/datetimeaxis/qdatetimeaxis.cpp index ed1b4a1..ac5900d 100644 --- a/src/axis/datetimeaxis/qdatetimeaxis.cpp +++ b/src/axis/datetimeaxis/qdatetimeaxis.cpp @@ -36,15 +36,15 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \mainclass The labels can be configured by setting an appropriate DateTime format. - QDateTimeAxis works correctly with dates from 4714 BCE to 287396 CE - There are also other limitiation related to QDateTime . Please refer to QDateTime documentation. + QDateTimeAxis works correctly with dates from 4714 BCE to 287396 CE. + There are also other limitiation related to QDateTime. Please refer to QDateTime documentation. QDateTimeAxis can be setup to show axis line with tick marks, grid lines and shades. Note: QDateTimeAxis is disabled on ARM architecture. \image api_datatime_axis.png - QDateTimeAxis can be used with QLineSeries, QSplineSeries or QScatterSeries. + QDateTimeAxis can be used with any QXYSeries. To add a data point to the series QDateTime::toMSecsSinceEpoch() is used. \code QLineSeries *series = new QLineSeries; diff --git a/src/axis/logvalueaxis/qlogvalueaxis.cpp b/src/axis/logvalueaxis/qlogvalueaxis.cpp index b948559..879fe24 100644 --- a/src/axis/logvalueaxis/qlogvalueaxis.cpp +++ b/src/axis/logvalueaxis/qlogvalueaxis.cpp @@ -41,7 +41,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - \qmlclass LogValuesAxis QLogValueAxis + \qmlclass LogValueAxis QLogValueAxis \brief The LogValueAxis element is used for manipulating chart's axes \inherits AbstractAxis @@ -58,7 +58,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Value has to be greater than 0. */ /*! - \qmlproperty real LogValuesAxis::min + \qmlproperty real LogValueAxis::min Defines the minimum value on the axis. When setting this property the max is adjusted if necessary, to ensure that the range remains valid. Value has to be greater than 0. @@ -71,7 +71,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Value has to be greater than 0. */ /*! - \qmlproperty real LogValuesAxis::max + \qmlproperty real LogValueAxis::max Defines the maximum value on the axis. When setting this property the min is adjusted if necessary, to ensure that the range remains valid. Value has to be greater than 0. @@ -83,7 +83,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Value has to be greater than 0 and not equal 1 */ /*! - \qmlproperty real LogValuesAxis::base + \qmlproperty real LogValueAxis::base Defines the maximum value on the axis. Defines the base of the logarithm. Value has to be greater than 0 and not equal 1 @@ -96,7 +96,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE See QString::sprintf() for additional details. */ /*! - \qmlproperty real LogValuesAxis::labelFormat + \qmlproperty real LogValueAxis::labelFormat Defines the label format of the axis. Supported specifiers are: d, i, o, x, X, f, F, e, E, g, G, c See QString::sprintf() for additional details. @@ -107,7 +107,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Axis emits signal when \a min of axis has changed. */ /*! - \qmlsignal LogValuesAxis::onMinChanged(qreal min) + \qmlsignal LogValueAxis::onMinChanged(qreal min) Axis emits signal when \a min of axis has changed. */ @@ -116,7 +116,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Axis emits signal when \a max of axis has changed. */ /*! - \qmlsignal LogValuesAxis::onMaxChanged(qreal max) + \qmlsignal LogValueAxis::onMaxChanged(qreal max) Axis emits signal when \a max of axis has changed. */ @@ -139,7 +139,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Axis emits signal when \a base of logarithm of the axis has changed. */ /*! - \qmlsignal LogValuesAxis::baseChanged(qreal base) + \qmlsignal LogValueAxis::baseChanged(qreal base) Axis emits signal when \a base of logarithm of the axis has changed. */ diff --git a/src/axis/qabstractaxis.cpp b/src/axis/qabstractaxis.cpp index 77c89b5..797aeb9 100644 --- a/src/axis/qabstractaxis.cpp +++ b/src/axis/qabstractaxis.cpp @@ -30,30 +30,22 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \brief The QAbstractAxis class is used for manipulating chart's axis. \mainclass - There is only one x Axis visible at the time, however there can be multiple y axes. - Each chart series can be bound to exactly one Y axis and the shared common X axis. - Axis can be setup to show axis line with tick marks, grid lines and shades. + Each series can be bound to one or more horizontal and vertical axes, but mixing axis types + that would result in different domains is not supported, such as specifying + QValueAxis and QLogValueAxis on the same orientation. + + Properties and visibility of various axis elements such as axis line, title, labels, grid lines, + and shades can be individually controlled. */ /*! \qmlclass AbstractAxis QAbstractAxis - \brief The Axis element is used for manipulating chart's axes - - There is only one x Axis visible at the time, however there can be multiple y axes on a ChartView. - Each chart series can be bound to exactly one Y axis and the shared common X axis. - Axis can be setup to show axis line with tick marks, grid lines and shades. - - To access Axes you can use ChartView API. For example: - \code - ChartView { - axisX.min: 0 - axisX.max: 3 - axisX.ticksCount: 4 - axisY.min: 0 - axisY.max: 4 - // Add a few series... - } - \endcode + \brief The AbstractAxis is a base element used for specialized axis elements + + Each series can be bound to only one horizontal and vertical axis. + + Properties and visibility of various axis elements such as axis line, title, labels, grid lines, + and shades can be individually controlled. */ /*! @@ -249,7 +241,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! \qmlproperty Qt.Orientation AbstractAxis::orientation - The orientation of the axis. Fixed to either Qt.Horizontal or Qt.Vertical when the axis is set to a Chart/Series. + The orientation of the axis. Fixed to either Qt.Horizontal or Qt.Vertical when the axis is set to a series. */ /*! diff --git a/src/axis/valueaxis/qvalueaxis.cpp b/src/axis/valueaxis/qvalueaxis.cpp index 80aa25c..5686b4f 100644 --- a/src/axis/valueaxis/qvalueaxis.cpp +++ b/src/axis/valueaxis/qvalueaxis.cpp @@ -62,7 +62,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE ValueAxis can be setup to show axis line with tick marks, grid lines and shades. Values of axis are drawn to position of ticks - To access Axes you can use ChartView API. For example: + Example about using ValueAxis: \code ChartView { ValueAxis { @@ -105,7 +105,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \qmlproperty real ValueAxis::tickCount Defines the number of ticks on the axis. This indicates how many grid lines are draw on the chart. - The default value is 5, and it can not be below 2. + The default value is 5, and it can not be below 2. */ /*! @@ -141,11 +141,11 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \fn void QValueAxis::tickCountChanged(int tickCount) - Axis emits signal when \a tickCount number on axis have changed. + Axis emits signal when \a tickCount of axis has changed. */ /*! \qmlsignal ValueAxis::tickCountChanged(int tickCount) - Axis emits signal when \a tickCount number on axis have changed. + Axis emits signal when \a tickCount of axis has changed. */ /*! @@ -159,7 +159,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! \qmlsignal ValueAxis::labelFormatChanged(const QString &format) - Axis emits signal when \a format of axis labels has changed. + Axis emits signal when \a format of axis labels has changed. */ /*! diff --git a/src/barchart/horizontal/bar/qhorizontalbarseries.cpp b/src/barchart/horizontal/bar/qhorizontalbarseries.cpp index 810417a..23ddba2 100644 --- a/src/barchart/horizontal/bar/qhorizontalbarseries.cpp +++ b/src/barchart/horizontal/bar/qhorizontalbarseries.cpp @@ -65,7 +65,7 @@ QHorizontalBarSeries::QHorizontalBarSeries(QObject *parent) } /*! - Destructor + Destructor. Removes series from chart. */ QHorizontalBarSeries::~QHorizontalBarSeries() diff --git a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp b/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp index ea5a015..57aaaa6 100644 --- a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp +++ b/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp @@ -70,7 +70,7 @@ QAbstractSeries::SeriesType QHorizontalPercentBarSeries::type() const } /*! - Destructor + Destructor. Removes series from chart. */ QHorizontalPercentBarSeries::~QHorizontalPercentBarSeries() diff --git a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp b/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp index c7fdc3d..418dd27 100644 --- a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp +++ b/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp @@ -61,7 +61,7 @@ QHorizontalStackedBarSeries::QHorizontalStackedBarSeries(QObject *parent) } /*! - Destructor + Destructor. Removes series from chart. */ QHorizontalStackedBarSeries::~QHorizontalStackedBarSeries() diff --git a/src/barchart/qbarset.cpp b/src/barchart/qbarset.cpp index 02c6182..ef5b337 100644 --- a/src/barchart/qbarset.cpp +++ b/src/barchart/qbarset.cpp @@ -195,14 +195,14 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \fn void QBarSet::valuesAdded(int index, int count) This signal is emitted when new values have been added to the set. Parameter \a index indicates the position of the first inserted value. - Parameter \a count is the number of iserted values. + Parameter \a count is the number of inserted values. \sa append(), insert() */ /*! \qmlsignal BarSet::onValuesAdded(int index, int count) This signal is emitted when new values have been added to the set. Parameter \a index indicates the position of the first inserted value. - Parameter \a count is the number of iserted values. + Parameter \a count is the number of inserted values. */ /*! @@ -248,7 +248,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - Constructs QBarSet with a label of \a label and with parent of \a parent + Constructs QBarSet with a label of \a label and with parent of \a parent. */ QBarSet::QBarSet(const QString label, QObject *parent) : QObject(parent), @@ -257,7 +257,7 @@ QBarSet::QBarSet(const QString label, QObject *parent) } /*! - Destroys the barset + Destroys the barset. */ QBarSet::~QBarSet() { @@ -316,7 +316,7 @@ QBarSet &QBarSet::operator << (const qreal &value) /*! Inserts new \a value on the \a index position. - The value that is currently at this postion is moved to postion index + 1 + The value that is currently at this postion is moved to position index + 1 \sa remove() */ void QBarSet::insert(const int index, const qreal value) @@ -338,7 +338,7 @@ void QBarSet::remove(const int index, const int count) } /*! - Sets a new value \a value to set, indexed by \a index + Sets a new value \a value to set, indexed by \a index. */ void QBarSet::replace(const int index, const qreal value) { diff --git a/src/barchart/qhbarmodelmapper.cpp b/src/barchart/qhbarmodelmapper.cpp index c24eefb..86bf662 100644 --- a/src/barchart/qhbarmodelmapper.cpp +++ b/src/barchart/qhbarmodelmapper.cpp @@ -31,7 +31,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Horizontal model mapper is used to create a connection between QAbstractBarSeries and QAbstractItemModel derived model object. Model mapper maintains equal size of all the BarSets. Adding/removing value from the BarSet causes the the same change in the rest of the BarSets added to the same series. - Note: used model has to support adding/removing rows/columns and modifying the data of the cells. + \note Used model has to support adding/removing rows/columns and modifying the data of the cells. */ /*! \qmlclass HBarModelMapper QHBarModelMapper diff --git a/src/barchart/qvbarmodelmapper.cpp b/src/barchart/qvbarmodelmapper.cpp index 5f99e98..ab05737 100644 --- a/src/barchart/qvbarmodelmapper.cpp +++ b/src/barchart/qvbarmodelmapper.cpp @@ -31,7 +31,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Vertical model mapper is used to create a connection between QAbstractBarSeries and QAbstractItemModel derived model object. Model mapper maintains equal size of all the BarSets. Adding/removing value from the BarSet causes the the same change in the rest of the BarSets added to the same series. - Note: used model has to support adding/removing rows/columns and modifying the data of the cells. + \note Used model has to support adding/removing rows/columns and modifying the data of the cells. */ /*! \qmlclass VBarModelMapper diff --git a/src/legend/qlegend.cpp b/src/legend/qlegend.cpp index 1920d25..f40b6b4 100644 --- a/src/legend/qlegend.cpp +++ b/src/legend/qlegend.cpp @@ -41,7 +41,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \brief Legend object \mainclass - QLegend is a graphical object, whics displays legend of the chart. Legend state is updated by QChart, when + QLegend is a graphical object for displaying the legend of the chart. Legend state is updated by QChart, when series have been changed. By default, legend is drawn by QChart, but user can set a new parent to legend and handle the drawing manually. User isn't supposed to create or delete legend objects, but can reference it via QChart class. diff --git a/src/piechart/qhpiemodelmapper.cpp b/src/piechart/qhpiemodelmapper.cpp index 3832907..946fb45 100644 --- a/src/piechart/qhpiemodelmapper.cpp +++ b/src/piechart/qhpiemodelmapper.cpp @@ -29,7 +29,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series. Horizontal model mapper is used to create a connection between QPieSeries and QAbstractItemModel derived model object that keeps the consecutive pie slices data in rows. It is possible to use both QAbstractItemModel and QPieSeries model API. QHPieModelMapper makes sure that Pie and the model are kept in sync. - Note: used model has to support adding/removing rows/columns and modifying the data of the cells. + \note Used model has to support adding/removing rows/columns and modifying the data of the cells. */ /*! \qmlclass HPieModelMapper QHPieModelMapper diff --git a/src/piechart/qpieseries.cpp b/src/piechart/qpieseries.cpp index 3a806cf..9b2aad3 100644 --- a/src/piechart/qpieseries.cpp +++ b/src/piechart/qpieseries.cpp @@ -41,7 +41,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE The slices can have any values as the QPieSeries will calculate its relative value to the sum of all slices. The actual slice size is determined by that relative value. - Pie size and position on the chart is controlled by using relative values which range from 0.0 to 1.0 + Pie size and position on the chart is controlled by using relative values which range from 0.0 to 1.0. These relate to the actual chart rectangle. By default the pie is defined as a full pie but it can also be a partial pie. @@ -519,7 +519,7 @@ bool QPieSeries::remove(QPieSlice *slice) /*! Takes a single \a slice from the series. Does not destroy the slice object. - NOTE: The series remains as the slice's parent object. You must set the + \note The series remains as the slice's parent object. You must set the parent object to take full ownership. Returns true if take was successful. diff --git a/src/piechart/qvpiemodelmapper.cpp b/src/piechart/qvpiemodelmapper.cpp index 3a904bd..0c600f5 100644 --- a/src/piechart/qvpiemodelmapper.cpp +++ b/src/piechart/qvpiemodelmapper.cpp @@ -29,7 +29,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Model mappers allow you to use QAbstractItemModel derived models as a data source for a chart series. Vertical model mapper is used to create a connection between QPieSeries and QAbstractItemModel derived model object that keeps the consecutive pie slices data in columns. It is possible to use both QAbstractItemModel and QPieSeries model API. QVPieModelMapper makes sure that Pie and the model are kept in sync. - Note: used model has to support adding/removing rows/columns and modifying the data of the cells. + \note Used model has to support adding/removing rows/columns and modifying the data of the cells. */ /*! \qmlclass VPieModelMapper QVPieModelMapper diff --git a/src/qabstractseries.cpp b/src/qabstractseries.cpp index 9dae53b..f391640 100644 --- a/src/qabstractseries.cpp +++ b/src/qabstractseries.cpp @@ -131,7 +131,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \internal - \brief Constructs ChartSeries object with \a parent. + \brief Constructs QAbstractSeries object with \a parent. */ QAbstractSeries::QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent) : QObject(parent), @@ -145,7 +145,7 @@ QAbstractSeries::QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent) : QAbstractSeries::~QAbstractSeries() { if (d_ptr->m_chart) - qFatal("Still binded series detected !"); + qFatal("Series still bound to a chart when destroyed!"); } void QAbstractSeries::setName(const QString &name) @@ -161,9 +161,6 @@ QString QAbstractSeries::name() const return d_ptr->m_name; } -/*! - Sets the visibility of series to \a visible -*/ void QAbstractSeries::setVisible(bool visible) { if (visible != d_ptr->m_visible) { @@ -172,9 +169,6 @@ void QAbstractSeries::setVisible(bool visible) } } -/*! - Returns the visibility of series -*/ bool QAbstractSeries::isVisible() const { return d_ptr->m_visible; diff --git a/src/qchart.cpp b/src/qchart.cpp index f2fd1b6..43414eb 100644 --- a/src/qchart.cpp +++ b/src/qchart.cpp @@ -73,10 +73,10 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \brief QtCommercial chart API. QChart is a QGraphicsWidget that you can show in a QGraphicsScene. It manages the graphical - representation of different types of series and other chart related objects like - QAxis and QLegend. If you simply want to show a chart in a layout, you can use the + representation of different types of series and other chart related objects like legend and + axes. If you simply want to show a chart in a layout, you can use the convenience class QChartView instead of QChart. - \sa QChartView + \sa QChartView, QPolarChart */ /*! @@ -86,7 +86,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \property QChart::backgroundVisible - Whether the chart background is visible or not. + Specifies whether the chart background is visible or not. \sa setBackgroundBrush(), setBackgroundPen() */ @@ -99,19 +99,22 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \property QChart::minimumMargins Minimum margins between the plot area (axes) and the edge of the chart widget. + This property is deprecated; use margins property instead. + + \sa margins */ /*! \property QChart::margins - Minimum between the plot area (axes) and the edge of the chart widget. + Margins between the plot area (axes) and the edge of the chart widget. */ /*! \property QChart::theme Theme is a built-in collection of UI style related settings applied for all visual elements of a chart, like colors, - pens, brushes and fonts of series, axes, title and legend. \l {Chart themes demo} shows an example with a few + pens, brushes, and fonts of series, axes, title, and legend. \l {Chart themes demo} shows an example with a few different themes. - Note: changing the theme will overwrite all customizations previously applied to the series. + \note Changing the theme will overwrite all customizations previously applied to the series. */ /*! @@ -122,7 +125,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \property QChart::chartType Chart type indicates if the chart is a cartesian chart or a polar chart. - This property is set internally and is read only. + This property is set internally and it is read only. \sa QPolarChart */ @@ -151,7 +154,7 @@ QChart::QChart(QGraphicsItem *parent, Qt::WindowFlags wFlags) } /*! - Destroys the object and it's children, like series and axis objects added to it. + Destroys the chart object and its children, like series and axis objects added to it. */ QChart::~QChart() { @@ -161,11 +164,16 @@ QChart::~QChart() } /*! - Adds the \a series onto the chart and takes the ownership of the object. - If auto scaling is enabled, re-scales the axes the series is bound to (both the x axis and - the y axis). + Adds the \a series onto the chart and takes the ownership of it. + + \note A newly added series is attached to no axes by default, including any axes that were created for the chart + using createDefaultAxes() before the series was added to the chart. If no axes are attached to + the newly added series before the chart is shown, the series will get drawn as if it had axes with ranges + that exactly fit the series to the plot area of the chart. This can be confusing if the same chart also displays other + series that have properly attached axes, so always make sure you either call createDefaultAxes() after + a series has been added or explicitly attach axes for the series. - \sa removeSeries(), removeAllSeries() + \sa removeSeries(), removeAllSeries(), createDefaultAxes(), QAbstractSeries::attachAxis() */ void QChart::addSeries(QAbstractSeries *series) { @@ -174,9 +182,9 @@ void QChart::addSeries(QAbstractSeries *series) } /*! - Removes the \a series specified in a perameter from the QChartView. - It releses its ownership of the specified QChartSeries object. - It does not delete the pointed QChartSeries data object + Removes the \a series from the chart. + The chart releases its ownership of the specified \a series object. + \sa addSeries(), removeAllSeries() */ void QChart::removeSeries(QAbstractSeries *series) @@ -186,8 +194,8 @@ void QChart::removeSeries(QAbstractSeries *series) } /*! - Removes all the QChartSeries that have been added to the QChartView - It also deletes the pointed QChartSeries data objects + Removes and deletes all series objects that have been added to the chart. + \sa addSeries(), removeSeries() */ void QChart::removeAllSeries() @@ -207,7 +215,7 @@ void QChart::setBackgroundBrush(const QBrush &brush) } /*! - Gets the brush that is used for painting the background of the chart area. + Gets the brush that is used for painting the background of the chart area. */ QBrush QChart::backgroundBrush() const { @@ -223,31 +231,25 @@ void QChart::setBackgroundPen(const QPen &pen) } /*! - Gets the pen that is used for painting the background of the chart area. + Gets the pen that is used for painting the background of the chart area. */ QPen QChart::backgroundPen() const { return d_ptr->m_presenter->backgroundPen(); } -/*! - Sets the chart \a title. The description text that is drawn above the chart. - */ void QChart::setTitle(const QString &title) { d_ptr->m_presenter->setTitle(title); } -/*! - Returns the chart title. The description text that is drawn above the chart. - */ QString QChart::title() const { return d_ptr->m_presenter->title(); } /*! - Sets the \a font that is used for drawing the chart description text that is rendered above the chart. + Sets the \a font that is used for drawing the chart title. */ void QChart::setTitleFont(const QFont &font) { @@ -255,7 +257,7 @@ void QChart::setTitleFont(const QFont &font) } /*! - Gets the font that is used for drawing the chart description text that is rendered above the chart. + Gets the font that is used for drawing the chart title. */ QFont QChart::titleFont() const { @@ -263,7 +265,7 @@ QFont QChart::titleFont() const } /*! - Sets the \a brush used for rendering the title text. + Sets the \a brush used for drawing the title text. */ void QChart::setTitleBrush(const QBrush &brush) { @@ -271,7 +273,7 @@ void QChart::setTitleBrush(const QBrush &brush) } /*! - Returns the brush used for rendering the title text. + Returns the brush used for drawing the title text. */ QBrush QChart::titleBrush() const { @@ -289,7 +291,7 @@ QChart::ChartTheme QChart::theme() const } /*! - Zooms in the view by a factor of 2 + Zooms in the view by a factor of two. */ void QChart::zoomIn() { @@ -308,7 +310,7 @@ void QChart::zoomIn(const QRectF &rect) } /*! - Restores the view zoom level to the previous one. + Zooms out the view by a factor of two. */ void QChart::zoomOut() { @@ -316,7 +318,7 @@ void QChart::zoomOut() } /*! - Zooms in the view by a \a factor. + Zooms in the view by a custom \a factor. A factor over 1.0 zooms the view in and factor between 0.0 and 1.0 zooms out. */ @@ -338,8 +340,10 @@ void QChart::zoom(qreal factor) } /*! - Returns the pointer to the x axis object of the chart associated with the specified \a series. - If no series is provided then pointer to currently visible axis is provided. + Returns a pointer to the horizontal axis attached to the specified \a series. + If no \a series is specified, the first horizontal axis added to the chart is returned. + + \sa addAxis(), QAbstractSeries::attachAxis() */ QAbstractAxis *QChart::axisX(QAbstractSeries *series) const { @@ -350,8 +354,10 @@ QAbstractAxis *QChart::axisX(QAbstractSeries *series) const } /*! - Returns the pointer to the y axis object of the chart associated with the specified \a series. - If no series is provided then pointer to currently visible axis is provided. + Returns a pointer to the vertical axis attached to the specified \a series. + If no \a series is specified, the first vertical axis added to the chart is returned. + + \sa addAxis(), QAbstractSeries::attachAxis() */ QAbstractAxis *QChart::axisY(QAbstractSeries *series) const { @@ -362,8 +368,8 @@ QAbstractAxis *QChart::axisY(QAbstractSeries *series) const } /*! - Returns the axes added for the \a series with \a orientation. If no series is provided, then all axes with the - specified orientation are returned. + Returns the axes attached to the \a series with \a orientation. If no \a series is provided, + then all axes added to the chart with the specified orientation are returned. \sa addAxis(), createDefaultAxes() */ QList QChart::axes(Qt::Orientations orientation, QAbstractSeries *series) const @@ -386,11 +392,15 @@ QList QChart::axes(Qt::Orientations orientation, QAbstractSerie } /*! - NOTICE: This function has to be called after series has been added to the chart if no customized axes are set to the chart. Otherwise axisX(), axisY() calls return NULL. + Creates axes for the chart based on the series that have already been added to the chart. Any axes previously added to + the chart will be deleted. - Creates the axes for the chart based on the series that has already been added to the chart. + \note This function has to be called after all series have been added to the chart. The axes created by this function + will NOT get automatically attached to any series added to the chart after this function has been called. + A series with no axes attached will by default scale to utilize the entire plot area of the chart, which can be confusing + if there are other series with properly attached axes also present. -\table + \table \header \o Series type \o X-axis @@ -407,17 +417,15 @@ QList QChart::axes(Qt::Orientations orientation, QAbstractSerie \o QPieSeries \o None \o None - \endtable + \endtable - If there are several QXYSeries derived series added to the chart and no other series type has been added then only one pair of axes is created. - If there are sevaral series added of different types then each series gets its own axes pair. + If there are several QXYSeries derived series added to the chart and no series of other types have been added, then only one pair of axes is created. + If there are several series of different types added to the chart, then each series gets its own axes pair. - NOTICE: if there is more than one x and y axes created then no axis is drawn by default and one needs to choose explicitly which axis should be shown. - - Axis specifix to the series can be later obtained from the chart by providing the series as the parameter of axisX(), axisY() function calls. + The axes specific to the series can be later obtained from the chart by providing the series as the parameter for axes() function call. QPieSeries does not create any axes. - \sa axisX(), axisY(), setAxisX(), setAxisY() + \sa axisX(), axisY(), axes(), setAxisX(), setAxisY(), QAbstractSeries::attachAxis() */ void QChart::createDefaultAxes() { @@ -425,46 +433,30 @@ void QChart::createDefaultAxes() } /*! - Returns the legend object of the chart. Ownership stays in chart. + Returns the legend object of the chart. Ownership stays with the chart. */ QLegend *QChart::legend() const { return d_ptr->m_legend; } -/*! - Sets the minimum \a margins between the plot area (axes) and the edge of the chart widget. - Deprecated. Use setMargins(). -*/ void QChart::setMinimumMargins(const QMargins &margins) { qWarning() << "QChart::setMinimumMargins is deprecated. Use QChart::setMargins instead."; d_ptr->m_presenter->layout()->setMargins(margins); } -/*! - Returns the rect that contains information about margins (distance between chart widget edge and axes). - Individual margins can be obtained by calling left, top, right, bottom on the returned rect. - Deprecated. Use margins(). - */ QMargins QChart::minimumMargins() const { qWarning() << "QChart::minimumMargins is deprecated. Use QChart::margins instead."; return d_ptr->m_presenter->layout()->margins(); } -/*! - Sets the minimum \a margins between the plot area (axes) and the edge of the chart widget. -*/ void QChart::setMargins(const QMargins &margins) { d_ptr->m_presenter->layout()->setMargins(margins); } -/*! - Returns the rect that contains information about margins (distance between chart widget edge and axes). - Individual margins can be obtained by calling left, top, right, bottom on the returned rect. - */ QMargins QChart::margins() const { return d_ptr->m_presenter->layout()->margins(); @@ -476,26 +468,14 @@ QChart::ChartType QChart::chartType() const } /*! - Returns the the rect within which the drawing of the chart is done. - It does not include the area defines by margins. + Returns the the rectangle within which the drawing of the chart is done. + It does not include the area defined by margins. */ QRectF QChart::plotArea() const { return d_ptr->m_presenter->geometry(); } -///*! -// TODO: Dummy. -// Adjust the ranges of the axes so that all the data of the specified \a series is visible -// */ -//void QChart::adjustViewToSeries(QAbstractSeries* series) -//{ -// // -//} - -/*! - Sets animation \a options for the chart - */ void QChart::setAnimationOptions(AnimationOptions options) { d_ptr->m_presenter->setAnimationOptions(options); @@ -537,7 +517,7 @@ bool QChart::isDropShadowEnabled() const } /*! - Returns all the series that are added to the chart. + Returns all series that are added to the chart. \sa addSeries(), removeSeries(), removeAllSeries() */ @@ -547,45 +527,50 @@ QList QChart::series() const } /*! - Sets \a axis to the chart, which will control the presentation of the \a series + Adds the \a axis to the chart and attaches it to the \a series as a bottom-aligned horizontal axis. + The chart takes ownership of both the \a axis and the \a series. + Any horizontal axes previously attached to the \a series are deleted. - \sa axisX(), axisY(), setAxisY(), createDefaultAxes() + \sa axisX(), axisY(), setAxisY(), createDefaultAxes(), QAbstractSeries::attachAxis() */ -void QChart::setAxisX(QAbstractAxis *axis , QAbstractSeries *series) +void QChart::setAxisX(QAbstractAxis *axis ,QAbstractSeries *series) { - QList list = axes(Qt::Horizontal,series); + QList list = axes(Qt::Horizontal, series); - foreach(QAbstractAxis* a, list){ + foreach (QAbstractAxis* a, list) { d_ptr->m_dataset->removeAxis(a); delete a; } - if(!d_ptr->m_dataset->axes().contains(axis)) - d_ptr->m_dataset->addAxis(axis,Qt::AlignBottom); - d_ptr->m_dataset->attachAxis(series,axis); + if (!d_ptr->m_dataset->axes().contains(axis)) + d_ptr->m_dataset->addAxis(axis, Qt::AlignBottom); + d_ptr->m_dataset->attachAxis(series, axis); } /*! - Sets \a axis to the chart, which will control the presentation of the \a series + Adds the \a axis to the chart and attaches it to the \a series as a left-aligned vertical axis. + The chart takes ownership of both the \a axis and the \a series. + Any vertical axes previously attached to the \a series are deleted. - \sa axisX(), axisY(), setAxisX(), createDefaultAxes() + \sa axisX(), axisY(), setAxisX(), createDefaultAxes(), QAbstractSeries::attachAxis() */ -void QChart::setAxisY(QAbstractAxis *axis , QAbstractSeries *series) +void QChart::setAxisY(QAbstractAxis *axis ,QAbstractSeries *series) { - QList list = axes(Qt::Vertical,series); + QList list = axes(Qt::Vertical, series); - foreach(QAbstractAxis* a, list) { + foreach (QAbstractAxis* a, list) { d_ptr->m_dataset->removeAxis(a); delete a; } - if(!d_ptr->m_dataset->axes().contains(axis)) - d_ptr->m_dataset->addAxis(axis,Qt::AlignLeft); - d_ptr->m_dataset->attachAxis(series,axis); + if (!d_ptr->m_dataset->axes().contains(axis)) + d_ptr->m_dataset->addAxis(axis, Qt::AlignLeft); + d_ptr->m_dataset->attachAxis(series, axis); } /*! - Adds \a axis to the chart with \a alignment. The chart takes the ownership of the axis. + Adds the \a axis to the chart with \a alignment. The chart takes the ownership of the axis. + \sa removeAxis(), createDefaultAxes(), QAbstractSeries::attachAxis() */ void QChart::addAxis(QAbstractAxis *axis, Qt::Alignment alignment) @@ -594,7 +579,9 @@ void QChart::addAxis(QAbstractAxis *axis, Qt::Alignment alignment) } /*! - Removes \a axis from the chart. The ownership is returned to the caller. + Removes the \a axis from the chart. + The chart releases its ownership of the specified \a axis object. + \sa addAxis(), createDefaultAxes(), QAbstractSeries::detachAxis() */ void QChart::removeAxis(QAbstractAxis *axis) @@ -603,7 +590,7 @@ void QChart::removeAxis(QAbstractAxis *axis) } /*! - Returns the value in the \a series domain that corresponds to the charts widget point defines by \a position. + Returns the value in the \a series domain that corresponds to the \a position relative to chart widget. */ QPointF QChart::mapToValue(const QPointF &position, QAbstractSeries *series) { @@ -611,7 +598,7 @@ QPointF QChart::mapToValue(const QPointF &position, QAbstractSeries *series) } /*! - Returns the position on the charts widget that corresponds to the \a value in the \a series domain. + Returns the position on the chart widget that corresponds to the \a value in the \a series domain. */ QPointF QChart::mapToPosition(const QPointF &value, QAbstractSeries *series) { @@ -640,7 +627,6 @@ QChartPrivate::QChartPrivate(QChart *q, QChart::ChartType type): QChartPrivate::~QChartPrivate() { - } void QChartPrivate::init() diff --git a/src/qchartview.cpp b/src/qchartview.cpp index f67082e..535f204 100644 --- a/src/qchartview.cpp +++ b/src/qchartview.cpp @@ -40,11 +40,10 @@ \brief Standalone charting widget. QChartView is a standalone widget that can display charts. It does not require separate - QGraphicsScene to work. It manages the graphical representation of different types of - series and other chart related objects like QAxis and QLegend. If you want to - display a chart in your existing QGraphicsScene, you can use the QChart class instead. + QGraphicsScene to work. If you want to display a chart in your existing QGraphicsScene, + you need to use the QChart (or QPolarChart) class instead. - \sa QChart + \sa QChart, QPolarChart */ QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -61,7 +60,8 @@ QChartView::QChartView(QWidget *parent) } /*! - Constructs a chartView object with parent \a parent to display a \a chart. + Constructs a chartview object with parent \a parent to display a \a chart. + Ownership of the \a chart is passed to chartview. */ QChartView::QChartView(QChart *chart, QWidget *parent) @@ -73,14 +73,14 @@ QChartView::QChartView(QChart *chart, QWidget *parent) /*! - Destroys the object and it's children, like series and axis objects added to it. + Destroys the chartview object and the associated chart. */ QChartView::~QChartView() { } /*! - Returns the pointer to the associated chart + Returns the pointer to the associated chart. */ QChart *QChartView::chart() const { @@ -91,7 +91,7 @@ QChart *QChartView::chart() const Sets the current chart to \a chart. Ownership of the new chart is passed to chartview and ownership of the previous chart is released. - To avoid memory leaks users needs to make sure the previous chart is deleted. + To avoid memory leaks users need to make sure the previous chart is deleted. */ void QChartView::setChart(QChart *chart) @@ -100,7 +100,10 @@ void QChartView::setChart(QChart *chart) } /*! - Sets the RubberBandPlicy to \a rubberBand. Selected policy determines the way zooming is performed. + Sets the rubber band flags to \a rubberBand. + Selected flags determine the way zooming is performed. + + \note Rubber band zooming is not supported for polar charts. */ void QChartView::setRubberBand(const RubberBands &rubberBand) { @@ -119,7 +122,7 @@ void QChartView::setRubberBand(const RubberBands &rubberBand) } /*! - Returns the RubberBandPolicy that is currently being used by the widget. + Returns the rubber band flags that are currently being used by the widget. */ QChartView::RubberBands QChartView::rubberBand() const { @@ -127,8 +130,8 @@ QChartView::RubberBands QChartView::rubberBand() const } /*! - If Left mouse button is pressed and the RubberBandPolicy is enabled the \a event is accepted and the rubber band is displayed on the screen allowing the user to select the zoom area. - If different mouse button is pressed and/or the RubberBandPolicy is disabled then the \a event is passed to QGraphicsView::mousePressEvent() implementation. + If Left mouse button is pressed and the rubber band is enabled the \a event is accepted and the rubber band is displayed on the screen allowing the user to select the zoom area. + If different mouse button is pressed and/or the rubber band is disabled then the \a event is passed to QGraphicsView::mousePressEvent() implementation. */ void QChartView::mousePressEvent(QMouseEvent *event) { @@ -148,8 +151,8 @@ void QChartView::mousePressEvent(QMouseEvent *event) } /*! - If RubberBand rectange specification has been initiated in pressEvent then \a event data is used to update RubberBand geometry. - In other case the defualt QGraphicsView::mouseMoveEvent implementation is called. + If the rubber band rectange has been displayed in pressEvent then \a event data is used to update the rubber band geometry. + Otherwise the default QGraphicsView::mouseMoveEvent implementation is called. */ void QChartView::mouseMoveEvent(QMouseEvent *event) { @@ -172,8 +175,9 @@ void QChartView::mouseMoveEvent(QMouseEvent *event) } /*! - If left mouse button is release and RubberBand is enabled then \a event is accepted and the view is zoomed in to rect specified by RubberBand - If it is the right mouse button \a event then RubberBand is dissmissed and zoom is canceled. + If left mouse button is released and the rubber band is enabled then \a event is accepted and + the view is zoomed into the rect specified by the rubber band. + If it is a right mouse button \a event then the rubber band is dismissed and the zoom is canceled. */ void QChartView::mouseReleaseEvent(QMouseEvent *event) { @@ -235,7 +239,6 @@ QChartViewPrivate::QChartViewPrivate(QChartView *q, QChart *chart) QChartViewPrivate::~QChartViewPrivate() { - } void QChartViewPrivate::setChart(QChart *chart) diff --git a/src/qpolarchart.cpp b/src/qpolarchart.cpp index 1d93d35..def3198 100644 --- a/src/qpolarchart.cpp +++ b/src/qpolarchart.cpp @@ -26,7 +26,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \enum QPolarChart::PolarOrientation - This type is used to signify the polar orientation of an axis. + This type is used to specify the polar orientation of an axis. \value PolarOrientationRadial \value PolarOrientationAngular @@ -46,7 +46,8 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \note If the angular distance between two consecutive points in a series is more than 180 degrees, any line connecting the two points becomes meaningless, so choose the axis ranges accordingly - when displaying line, spline, or area series. + when displaying line, spline, or area series. In such case series don't draw a direct line between + the two points, but instead draw a line to and from the center of the chart. \note Polar charts do not support multiple axes of same orientation. @@ -54,7 +55,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - Constructs a polar chart as a child of a \a parent. + Constructs a polar chart as a child of the \a parent. Parameter \a wFlags is passed to the QChart constructor. */ QPolarChart::QPolarChart(QGraphicsItem *parent, Qt::WindowFlags wFlags) @@ -63,7 +64,7 @@ QPolarChart::QPolarChart(QGraphicsItem *parent, Qt::WindowFlags wFlags) } /*! - Destroys the object and it's children, like series and axis objects added to it. + Destroys the polar chart object and its children, like series and axis objects added to it. */ QPolarChart::~QPolarChart() { @@ -72,6 +73,7 @@ QPolarChart::~QPolarChart() /*! Returns the axes added for the \a series with \a polarOrientation. If no series is provided, then any axis with the specified polar orientation is returned. + \sa addAxis() */ QList QPolarChart::axes(PolarOrientations polarOrientation, QAbstractSeries *series) const @@ -92,6 +94,7 @@ QList QPolarChart::axes(PolarOrientations polarOrientation, QAb \note Axes can be added to a polar chart also with QChart::addAxis() instead of this method. The specified alignment determines the polar orientation: horizontal alignments indicate angular axis and vertical alignments indicate radial axis. + \sa QChart::removeAxis(), QChart::createDefaultAxes(), QAbstractSeries::attachAxis(), QChart::addAxis() */ void QPolarChart::addAxis(QAbstractAxis *axis, PolarOrientation polarOrientation) diff --git a/src/splinechart/qsplineseries.cpp b/src/splinechart/qsplineseries.cpp index a08d144..bcf9507 100644 --- a/src/splinechart/qsplineseries.cpp +++ b/src/splinechart/qsplineseries.cpp @@ -83,7 +83,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! Constructs empty series object which is a child of \a parent. - When series object is added to QChartView or QChart instance then the ownerships is transferred. + When series object is added to a QChart instance then the ownerships is transferred. */ QSplineSeries::QSplineSeries(QObject *parent) diff --git a/src/xychart/qxyseries.cpp b/src/xychart/qxyseries.cpp index 37c7355..1de83d8 100644 --- a/src/xychart/qxyseries.cpp +++ b/src/xychart/qxyseries.cpp @@ -154,7 +154,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \fn void QXYSeries::pointsReplaced() - Signal is emitted when all points have been replaced with another points. + Signal is emitted when all points have been replaced with other points. \sa replace() */ /*! @@ -226,7 +226,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \internal Constructs empty series object which is a child of \a parent. - When series object is added to QChartView or QChart instance ownerships is transferred. + When series object is added to QChart instance ownerships is transferred. */ QXYSeries::QXYSeries(QXYSeriesPrivate &d, QObject *parent) : QAbstractSeries(d, parent) @@ -234,15 +234,15 @@ QXYSeries::QXYSeries(QXYSeriesPrivate &d, QObject *parent) } /*! - Destroys the object. Series added to QChartView or QChart instances are owned by those, - and are deleted when mentioned object are destroyed. + Destroys the object. Series added to QChart instances are owned by those, + and are destroyed when QChart instances are destroyed. */ QXYSeries::~QXYSeries() { } /*! - Adds data point \a x \a y to the series. Points are connected with lines on the chart. + Adds data point (\a x, \a y) to the series. */ void QXYSeries::append(qreal x, qreal y) { @@ -251,7 +251,7 @@ void QXYSeries::append(qreal x, qreal y) /*! This is an overloaded function. - Adds data \a point to the series. Points are connected with lines on the chart. + Adds data \a point to the series. */ void QXYSeries::append(const QPointF &point) { @@ -265,7 +265,7 @@ void QXYSeries::append(const QPointF &point) /*! This is an overloaded function. - Adds list of data \a points to the series. Points are connected with lines on the chart. + Adds list of data \a points to the series. */ void QXYSeries::append(const QList &points) { @@ -274,7 +274,7 @@ void QXYSeries::append(const QList &points) } /*! - Replaces data point \a oldX \a oldY with data point \a newX \a newY. + Replaces data point (\a oldX, \a oldY) with data point (\a newX, \a newY). \sa QXYSeries::pointReplaced() */ void QXYSeries::replace(qreal oldX, qreal oldY, qreal newX, qreal newY) @@ -299,7 +299,8 @@ void QXYSeries::replace(const QPointF &oldPoint, const QPointF &newPoint) } /*! - Replaces the current points with \a points. This is faster than replacing data points one by one, + Replaces the current points with \a points. + \note This is much faster than replacing data points one by one, or first clearing all data, and then appending the new data. Emits QXYSeries::pointsReplaced() when the points have been replaced. \sa QXYSeries::pointsReplaced() @@ -312,7 +313,7 @@ void QXYSeries::replace(QList points) } /*! - Removes current \a x and \a y value. + Removes the point (\a x, \a y) from the series. */ void QXYSeries::remove(qreal x, qreal y) { @@ -320,9 +321,7 @@ void QXYSeries::remove(qreal x, qreal y) } /*! - Removes current \a point x value. - - Note: point y value is ignored. + Removes the \a point from the series. */ void QXYSeries::remove(const QPointF &point) {