##// END OF EJS Templates
Fix naming convention for lineseries...
Fix naming convention for lineseries * rename QXYChartSeries to QLineChartSeries * rename XYChartItem to LineChartItem

File last commit:

r144:f5ae8394e133
r144:f5ae8394e133
Show More
qxychartseries.cpp
77 lines | 1.3 KiB | text/x-c | CppLexer
Michal Klocek
Refactor current draft to fit int current design specs...
r21 #include "qxychartseries.h"
Tero Ahola
Renamed to QtCommercialChart
r30 QTCOMMERCIALCHART_BEGIN_NAMESPACE
Michal Klocek
Refactor current draft to fit int current design specs...
r21
Michal Klocek
Refactora axis and line chart to use graphics items insted of painter.
r85 QXYChartSeries::QXYChartSeries(QObject* parent):QChartSeries(parent)
Michal Klocek
Refactor current draft to fit int current design specs...
r21 {
}
QXYChartSeries::~QXYChartSeries()
{
}
QXYChartSeries* QXYChartSeries::create(QObject* parent)
{
//TODO: here we take QChartData when it is ready
// return null if malformed;
return new QXYChartSeries(parent);
}
Michal Klocek
Refactors qchart , adds line animation...
r131 int QXYChartSeries::add(qreal x,qreal y)
Michal Klocek
Refactor current draft to fit int current design specs...
r21 {
m_x<<x;
m_y<<y;
Michal Klocek
Refactors qchart , adds line animation...
r131 return m_x.size()-1;
}
void QXYChartSeries::set(int index,qreal x,qreal y)
{
m_x[index]=x;
m_y[index]=y;
emit changed(index);
Michal Klocek
Refactor current draft to fit int current design specs...
r21 }
void QXYChartSeries::clear()
{
m_x.clear();
m_y.clear();
}
qreal QXYChartSeries::x(int pos) const
{
return m_x.at(pos);
}
qreal QXYChartSeries::y(int pos) const
{
return m_y.at(pos);
}
int QXYChartSeries::count() const
{
Q_ASSERT(m_x.size() == m_y.size());
return m_x.size();
}
Michal Klocek
Refactora axis and line chart to use graphics items insted of painter.
r85 void QXYChartSeries::setPen(const QPen& pen)
{
m_pen=pen;
}
Michal Klocek
Refactor current draft to fit int current design specs...
r21 QDebug operator<< (QDebug debug, const QXYChartSeries series)
{
Q_ASSERT(series.m_x.size() == series.m_y.size());
int size = series.m_x.size();
for (int i=0;i<size;i++) {
debug.nospace() << "(" << series.m_x.at(i) << ','<< series.m_y.at(i) << ") ";
}
return debug.space();
}
Michal Klocek
Refactors qchart , adds line animation...
r131 #include "moc_qxychartseries.cpp"
Tero Ahola
Renamed to QtCommercialChart
r30 QTCOMMERCIALCHART_END_NAMESPACE