Changeset 8719:9b7e8a69fbb2 in orange


Ignore:
Timestamp:
08/16/11 10:25:54 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
00de0c851afec0592487b67543a5585e3479c7ea
Message:

Allow the possibility of both lines and points being displayed at the same time.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/plot/owplot.py

    r8716 r8719  
    13331333            return self.axes[axis_id].bounds() 
    13341334        if try_auto_scale: 
    1335             return orangeqt.Plot.bounds_for_axis(self, axis_id) 
     1335            lower, upper = orangeqt.Plot.bounds_for_axis(self, axis_id) 
     1336            if lower != upper: 
     1337          lower = lower - (upper-lower)/20.0 
     1338          upper = upper + (upper-lower)/20.0 
     1339        return lower, upper 
    13361340        else: 
    13371341            return None, None 
  • source/orangeqt/curve.cpp

    r8715 r8719  
    4141    m_style = NoCurve; 
    4242    m_continuous = false; 
    43     m_lineItem = 0; 
    4443    m_needsUpdate = UpdateAll; 
     44    m_lineItem = new QGraphicsPathItem(this); 
    4545    set_data(x_data, y_data); 
    4646    QObject::connect(&m_pos_watcher, SIGNAL(finished()), SLOT(pointMapFinished())); 
     
    5454    m_autoUpdate = true; 
    5555    m_style = NoCurve; 
    56     m_lineItem = 0; 
     56    m_lineItem = new QGraphicsPathItem(this); 
    5757    m_needsUpdate = 0; 
    5858    QObject::connect(&m_pos_watcher, SIGNAL(finished()), SLOT(pointMapFinished())); 
     
    8282  cancel_all_updates(); 
    8383     
    84   if (m_style < UserCurve && m_continuous != (m_style != Curve::NoCurve)) 
    85   { 
    86       m_continuous = (m_style != Curve::NoCurve); 
    87       m_needsUpdate |= UpdateContinuous; 
    88   } 
    89      
    90   if (m_needsUpdate & UpdateContinuous) 
    91   { 
    92       changeContinuous(); 
    93   } 
     84  m_continuous = (m_style == Curve::Lines); 
     85  m_lineItem->setVisible(m_continuous); 
    9486   
    9587  if (m_continuous) 
     
    9991    m_lineItem->setPen(p); 
    10092    m_lineItem->setPath(continuous_path()); 
    101     return; 
    10293  }  
    10394   
  • source/orangeqt/curve.h

    r8715 r8719  
    310310{ 
    311311    const int n = values.size(); 
     312    if (n != m_pointItems.size()) 
     313    { 
     314    return; 
     315    } 
    312316    for (int i = 0; i < n; ++i) 
    313317    { 
Note: See TracChangeset for help on using the changeset viewer.