##// END OF EJS Templates
removed insertbarset from barseries
removed insertbarset from barseries

File last commit:

r995:d52b7de4b911
r1007:4ea342d1089d
Show More
qscatterseries.cpp
150 lines | 3.8 KiB | text/x-c | CppLexer
Jani Honkonen
Add license headers
r794 /****************************************************************************
**
** Copyright (C) 2012 Digia Plc
** All rights reserved.
** For any questions to Digia, please use contact form at http://qt.digia.com
**
** This file is part of the Qt Commercial Charts Add-on.
**
** $QT_BEGIN_LICENSE$
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.digia.com
** $QT_END_LICENSE$
**
****************************************************************************/
Tero Ahola
Integrated scatter type series...
r42 #include "qscatterseries.h"
Michal Klocek
Adds big fat pimpl to series classes...
r938 #include "qscatterseries_p.h"
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943 #include "scatterchartitem_p.h"
#include "chartdataset_p.h"
#include "charttheme_p.h"
#include "chartanimator_p.h"
Tero Ahola
Integrated scatter type series...
r42
Tero Ahola
Scatter series documentation; now uses snippets
r300 /*!
\class QScatterSeries
Michal Klocek
Fixes for docs , adds xyseries docs
r481 \brief The QScatterSeries class is used for making scatter charts.
Tero Ahola
Integrated scatter type series...
r42
Tero Ahola
Scatter series documentation; now uses snippets
r300 \mainclass
Michal Klocek
Fixes for docs , adds xyseries docs
r481 The scatter data is displayed as a collection of points on the chart. Each point determines the position on the horizontal axis
and the vertical axis.
Tero Ahola
Scatter series documentation; now uses snippets
r300
Tero Ahola
Documentation fixes....
r995 \image examples_scatterchart.png
Tero Ahola
Scatter series documentation; now uses snippets
r300
Michal Klocek
Fixes for docs , adds xyseries docs
r481 Creating basic scatter chart is simple:
\code
QScatterSeries* series = new QScatterSeries();
Jani Honkonen
rename functions add() -> append()
r796 series->append(0, 6);
series->append(2, 4);
Michal Klocek
Fixes for docs , adds xyseries docs
r481 ...
Tero Ahola
Documentation fixes....
r995 chart->addSeries(series);
Michal Klocek
Fixes for docs , adds xyseries docs
r481 \endcode
Tero Ahola
Scatter series documentation; now uses snippets
r300 */
Tero Ahola
Integrated scatter type series...
r42
Tero Ahola
Documenting QScatterSeries
r261 /*!
\enum QScatterSeries::MarkerShape
This enum describes the shape used when rendering marker items.
\value MarkerShapeCircle
Michal Klocek
Adds missing scatter intercation implementation...
r541 \value MarkerShapeRectangle
Tero Ahola
Documenting QScatterSeries
r261 */
Tero Ahola
QDoc to use style sheets...
r260 /*!
Tero Ahola
Scatter series documentation; now uses snippets
r300 \fn QChartSeriesType QScatterSeries::type() const
\brief Returns QChartSeries::SeriesTypeScatter.
Tero Ahola
Renamed QSeries to QAbstractSeries
r988 \sa QAbstractSeries, QSeriesType
Tero Ahola
Scatter series documentation; now uses snippets
r300 */
Tero Ahola
QDoc to use style sheets...
r260
Tero Ahola
Scatter series documentation; now uses snippets
r300 QTCOMMERCIALCHART_BEGIN_NAMESPACE
Tero Ahola
Documenting QScatterSeries
r261 /*!
Constructs a series object which is a child of \a parent.
*/
Michal Klocek
Adds big fat pimpl to series classes...
r938 QScatterSeries::QScatterSeries(QObject *parent) : QXYSeries(*new QScatterSeriesPrivate(this),parent)
Tero Ahola
Integrated scatter type series...
r42 {
}
Tero Ahola
QDoc to use style sheets...
r260 /*!
Tero Ahola
Documenting QScatterSeries
r261 Destroys the object. Note that adding series to QChart transfers the ownership to the chart.
Tero Ahola
QDoc to use style sheets...
r260 */
Tero Ahola
Integrated scatter again. Missing functionality....
r158 QScatterSeries::~QScatterSeries()
Tero Ahola
Integrated scatter type series...
r42 {
Tero Ahola
Resizing of QGraphicItems now possible by resize signal from QChart
r48 }
Tero Ahola
Renamed QSeries to QAbstractSeries
r988 QAbstractSeries::QSeriesType QScatterSeries::type() const
Michal Klocek
Adds big fat pimpl to series classes...
r938 {
Tero Ahola
Renamed QSeries to QAbstractSeries
r988 return QAbstractSeries::SeriesTypeScatter;
Michal Klocek
Adds big fat pimpl to series classes...
r938 }
Tero Ahola
Documenting QScatterSeries
r261 /*!
Tero Ahola
Scatter API review: changed signal now private etc.
r459 Returns the shape used for drawing markers.
Tero Ahola
Documenting QScatterSeries
r261 */
Tero Ahola
Scatter API review: changed signal now private etc.
r459 QScatterSeries::MarkerShape QScatterSeries::shape() const
Tero Ahola
Scatter series marker visuals
r195 {
Michal Klocek
Adds big fat pimpl to series classes...
r938 Q_D(const QScatterSeries);
return d->m_shape;
Tero Ahola
Scatter series marker visuals
r195 }
Tero Ahola
Documenting QScatterSeries
r261 /*!
Tero Ahola
Scatter series documentation; now uses snippets
r300 Overrides the default shape of the marker items with a user defined \a shape. The default shape
is defined by chart theme setting.
Tero Ahola
Documenting QScatterSeries
r261 */
Tero Ahola
Fixing review findings in QScatterSeries
r358 void QScatterSeries::setShape(MarkerShape shape)
Tero Ahola
Scatter series marker visuals
r195 {
Michal Klocek
Adds big fat pimpl to series classes...
r938 Q_D(QScatterSeries);
if (d->m_shape != shape) {
d->m_shape = shape;
emit d->updated();
Michal Klocek
minor. cleanuup in scatter API
r573 }
Tero Ahola
Scatter series marker visuals
r195 }
Tero Ahola
Added size customization to QScatterSeries
r397 /*!
Returns the size of the marker items.
*/
Tero Ahola
Scatter API review: changed signal now private etc.
r459 qreal QScatterSeries::size() const
Tero Ahola
Added size customization to QScatterSeries
r397 {
Michal Klocek
Adds big fat pimpl to series classes...
r938 Q_D(const QScatterSeries);
return d->m_size;
Tero Ahola
Added size customization to QScatterSeries
r397 }
/*!
Tero Ahola
Fixed bug in the documentation of scatter
r814 Set the \a size of the marker items. The default size is 15.
Tero Ahola
Added size customization to QScatterSeries
r397 */
void QScatterSeries::setSize(qreal size)
{
Michal Klocek
Adds big fat pimpl to series classes...
r938 Q_D(QScatterSeries);
if (!qFuzzyIsNull(d->m_size - size)) {
d->m_size = size;
emit d->updated();
Michal Klocek
minor. cleanuup in scatter API
r573 }
Tero Ahola
Added size customization to QScatterSeries
r397 }
Michal Klocek
Adds big fat pimpl to series classes...
r938 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
QScatterSeriesPrivate::QScatterSeriesPrivate(QScatterSeries* q):QXYSeriesPrivate(q),
m_shape(QScatterSeries::MarkerShapeCircle),
m_size(15.0)
{
};
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943 Chart* QScatterSeriesPrivate::createGraphics(ChartPresenter* presenter)
{
Q_Q(QScatterSeries);
ScatterChartItem *scatter = new ScatterChartItem(q,presenter);
if(presenter->animationOptions().testFlag(QChart::SeriesAnimations)) {
presenter->animator()->addAnimation(scatter);
}
presenter->chartTheme()->decorate(q, presenter->dataSet()->seriesIndex(q));
return scatter;
}
Michal Klocek
Adds big fat pimpl to series classes...
r938
Tero Ahola
Integrated scatter type series...
r42 QTCOMMERCIALCHART_END_NAMESPACE