##// 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 56 \enum QAbstractAxis::AxisType
57 57
58 The type of the series object.
58 The type of the axis object.
59 59
60 60 \value AxisTypeNoAxis
61 61 \value AxisTypeValue
@@ -72,9 +72,9 public:
72 72 AxisTypeNoAxis = 0x0,
73 73 AxisTypeValue = 0x1,
74 74 AxisTypeBarCategory = 0x2,
75 AxisTypeCategory = 0x3,
76 AxisTypeDateTime = 0x4,
77 AxisTypeLogValue = 0x5
75 AxisTypeCategory = 0x4,
76 AxisTypeDateTime = 0x8,
77 AxisTypeLogValue = 0x10
78 78 };
79 79
80 80 Q_DECLARE_FLAGS(AxisTypes, AxisType)
@@ -316,22 +316,8 void ChartDataSet::createDefaultAxes()
316 316 typeY |= s->d_ptr->defaultAxisType(Qt::Vertical);
317 317 }
318 318
319 // Create the axes of the types selected
320 // As long as AxisType enum balues are sequential a check to see if there are series of
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
319 createAxes(typeX, Qt::Horizontal);
320 createAxes(typeY, Qt::Vertical);
335 321 }
336 322
337 323 void ChartDataSet::createAxes(QAbstractAxis::AxisTypes type, Qt::Orientation orientation)
@@ -370,9 +356,8 void ChartDataSet::createAxes(QAbstractAxis::AxisTypes type, Qt::Orientation ori
370 356 attachAxis(s,axis);
371 357 }
372 358 axis->setRange(min,max);
373 }
374 else if (type.testFlag(QAbstractAxis::AxisTypeNoAxis)) {
375 //create separate axis
359 } else {
360 // Create separate axis for each series
376 361 foreach(QAbstractSeries *s, m_seriesList) {
377 362 QAbstractAxis *axis = s->d_ptr->createDefaultAxis(orientation);
378 363 if(axis) {
General Comments 0
You need to be logged in to leave comments. Login now