##// END OF EJS Templates
make setAxisX setAxisY functionality compatible
Michal Klocek -
r2278:c185a1f604d6
parent child
Show More
@@ -307,8 +307,6 QAbstractAxis *QChart::axisX(QAbstractSeries *series) const
307 {
307 {
308 if(!series && d_ptr->m_dataset->series().size()>0){
308 if(!series && d_ptr->m_dataset->series().size()>0){
309 series = d_ptr->m_dataset->series().first();
309 series = d_ptr->m_dataset->series().first();
310 }else{
311 return 0;
312 }
310 }
313
311
314 QList<QAbstractAxis*> axes = series->attachedAxes();
312 QList<QAbstractAxis*> axes = series->attachedAxes();
@@ -336,8 +334,6 QAbstractAxis *QChart::axisY(QAbstractSeries *series) const
336 {
334 {
337 if(!series && d_ptr->m_dataset->series().size()>0) {
335 if(!series && d_ptr->m_dataset->series().size()>0) {
338 series = d_ptr->m_dataset->series().first();
336 series = d_ptr->m_dataset->series().first();
339 } else {
340 return 0;
341 }
337 }
342
338
343 QList<QAbstractAxis*> axes = series->attachedAxes();
339 QList<QAbstractAxis*> axes = series->attachedAxes();
@@ -536,11 +532,9 void QChart::setAxisX(QAbstractAxis *axis , QAbstractSeries *series)
536 QList<QAbstractAxis*> list = axes(Qt::Horizontal,series);
532 QList<QAbstractAxis*> list = axes(Qt::Horizontal,series);
537
533
538 foreach(QAbstractAxis* a, list){
534 foreach(QAbstractAxis* a, list){
539 if(a->alignment()==axis->alignment()){
540 d_ptr->m_dataset->removeAxis(a);
535 d_ptr->m_dataset->removeAxis(a);
541 delete a;
536 delete a;
542 }
537 }
543 }
544
538
545 if(!d_ptr->m_dataset->axes().contains(axis))
539 if(!d_ptr->m_dataset->axes().contains(axis))
546 d_ptr->m_dataset->addAxis(axis,Qt::AlignBottom);
540 d_ptr->m_dataset->addAxis(axis,Qt::AlignBottom);
@@ -557,11 +551,9 void QChart::setAxisY(QAbstractAxis *axis , QAbstractSeries *series)
557 QList<QAbstractAxis*> list = axes(Qt::Vertical,series);
551 QList<QAbstractAxis*> list = axes(Qt::Vertical,series);
558
552
559 foreach(QAbstractAxis* a, list) {
553 foreach(QAbstractAxis* a, list) {
560 if(a->alignment()==axis->alignment()) {
561 d_ptr->m_dataset->removeAxis(a);
554 d_ptr->m_dataset->removeAxis(a);
562 delete a;
555 delete a;
563 }
556 }
564 }
565
557
566 if(!d_ptr->m_dataset->axes().contains(axis))
558 if(!d_ptr->m_dataset->axes().contains(axis))
567 d_ptr->m_dataset->addAxis(axis,Qt::AlignLeft);
559 d_ptr->m_dataset->addAxis(axis,Qt::AlignLeft);
General Comments 0
You need to be logged in to leave comments. Login now