##// END OF EJS Templates
Values and Intervals axes ranges are now initialized only if they haven't been preset earlier
Marek Rosa -
r1703:d83729eb88d8
parent child
Show More
@@ -32,7 +32,7 int main(int argc, char *argv[])
32
32
33 //![1]
33 //![1]
34 QLineSeries* series = new QLineSeries();
34 QLineSeries* series = new QLineSeries();
35 *series << QPointF(0, 6) << QPointF(9, 4) << QPointF(15, 20) << QPointF(25, 12) << QPointF(29, 26);
35 *series << QPointF(0, 6) << QPointF(9, 4) << QPointF(15, 20) << QPointF(25, 12) << QPointF(39, 36);
36 QChart* chart = new QChart();
36 QChart* chart = new QChart();
37 chart->legend()->hide();
37 chart->legend()->hide();
38 chart->addSeries(series);
38 chart->addSeries(series);
@@ -95,18 +95,14 int main(int argc, char *argv[])
95 axisX->append("optimal", 20);
95 axisX->append("optimal", 20);
96 axisX->append("high", 30);
96 axisX->append("high", 30);
97 axisX->setRange(0, 30);
97 axisX->setRange(0, 30);
98 // axisX->setRange("low","high");
99
98
100 axisY->append("slow", 10);
99 axisY->append("slow", 10);
101 axisY->append("med", 20);
100 axisY->append("med", 20);
102 axisY->append("fast", 30);
101 axisY->append("fast", 30);
103 axisY->setRange(0, 30);
102 axisY->setRange(0, 30);
104 // axisY->setRange("slow","fast");
105
103
106 chart->setAxisX(axisX, series);
104 chart->setAxisX(axisX, series);
107 chart->setAxisY(axisY, series);
105 chart->setAxisY(axisY, series);
108 axisX->setRange(0, 30);
109 axisY->setRange(0, 30);
110 //![4]
106 //![4]
111
107
112 //![5]
108 //![5]
@@ -87,7 +87,7 void QIntervalsAxis::append(const QString& intervalLabel, qreal interval)
87 d->m_intervalsMap.insert(intervalLabel, Range(range.second,interval));
87 d->m_intervalsMap.insert(intervalLabel, Range(range.second,interval));
88 d->m_intervals.append(intervalLabel);
88 d->m_intervals.append(intervalLabel);
89 }
89 }
90 setRange(d->m_min,interval);
90 // setRange(d->m_min,interval);
91 }
91 }
92 }
92 }
93
93
@@ -318,6 +318,12 void QValuesAxisPrivate::intializeDomain(Domain* domain)
318 m_min = domain->minX();
318 m_min = domain->minX();
319 m_max = domain->maxX();
319 m_max = domain->maxX();
320 }
320 }
321 } else {
322 if(m_orientation==Qt::Vertical){
323 domain->setRangeY(m_min, m_max);
324 }else{
325 domain->setRangeX(m_min, m_max);
326 }
321 }
327 }
322 }
328 }
323
329
General Comments 0
You need to be logged in to leave comments. Login now