##// END OF EJS Templates
Fix QAbstractAxis::AxisTypes enum values....
Miikka Heikkinen -
r2719:5490e1de47f4
parent child
Show More
@@ -55,7 +55,7 QT_CHARTS_BEGIN_NAMESPACE
55 /*!
55 /*!
56 \enum QAbstractAxis::AxisType
56 \enum QAbstractAxis::AxisType
57
57
58 The type of the series object.
58 The type of the axis object.
59
59
60 \value AxisTypeNoAxis
60 \value AxisTypeNoAxis
61 \value AxisTypeValue
61 \value AxisTypeValue
@@ -72,9 +72,9 public:
72 AxisTypeNoAxis = 0x0,
72 AxisTypeNoAxis = 0x0,
73 AxisTypeValue = 0x1,
73 AxisTypeValue = 0x1,
74 AxisTypeBarCategory = 0x2,
74 AxisTypeBarCategory = 0x2,
75 AxisTypeCategory = 0x3,
75 AxisTypeCategory = 0x4,
76 AxisTypeDateTime = 0x4,
76 AxisTypeDateTime = 0x8,
77 AxisTypeLogValue = 0x5
77 AxisTypeLogValue = 0x10
78 };
78 };
79
79
80 Q_DECLARE_FLAGS(AxisTypes, AxisType)
80 Q_DECLARE_FLAGS(AxisTypes, AxisType)
@@ -316,22 +316,8 void ChartDataSet::createDefaultAxes()
316 typeY |= s->d_ptr->defaultAxisType(Qt::Vertical);
316 typeY |= s->d_ptr->defaultAxisType(Qt::Vertical);
317 }
317 }
318
318
319 // Create the axes of the types selected
319 createAxes(typeX, Qt::Horizontal);
320 // As long as AxisType enum balues are sequential a check to see if there are series of
320 createAxes(typeY, Qt::Vertical);
321 // different types is needed. In such cases AxisTypeNoAxis is used to create separate axes
322 // for the types.
323 if (typeX != QAbstractAxis::AxisTypeNoAxis) {
324 if (typeX != m_seriesList.first()->d_ptr->defaultAxisType(Qt::Horizontal))
325 typeX = QAbstractAxis::AxisTypeNoAxis;
326 createAxes(typeX, Qt::Horizontal);
327 }
328
329 if (typeY != QAbstractAxis::AxisTypeNoAxis) {
330 if (typeY != m_seriesList.first()->d_ptr->defaultAxisType(Qt::Vertical))
331 typeY = QAbstractAxis::AxisTypeNoAxis;
332 createAxes(typeY, Qt::Vertical);
333 }
334
335 }
321 }
336
322
337 void ChartDataSet::createAxes(QAbstractAxis::AxisTypes type, Qt::Orientation orientation)
323 void ChartDataSet::createAxes(QAbstractAxis::AxisTypes type, Qt::Orientation orientation)
@@ -370,9 +356,8 void ChartDataSet::createAxes(QAbstractAxis::AxisTypes type, Qt::Orientation ori
370 attachAxis(s,axis);
356 attachAxis(s,axis);
371 }
357 }
372 axis->setRange(min,max);
358 axis->setRange(min,max);
373 }
359 } else {
374 else if (type.testFlag(QAbstractAxis::AxisTypeNoAxis)) {
360 // Create separate axis for each series
375 //create separate axis
376 foreach(QAbstractSeries *s, m_seriesList) {
361 foreach(QAbstractSeries *s, m_seriesList) {
377 QAbstractAxis *axis = s->d_ptr->createDefaultAxis(orientation);
362 QAbstractAxis *axis = s->d_ptr->createDefaultAxis(orientation);
378 if(axis) {
363 if(axis) {
General Comments 0
You need to be logged in to leave comments. Login now