Changeset 8298:8e5c14ea2c19 in orange


Ignore:
Timestamp:
06/04/11 11:16:02 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
5a10f6fd1119c158ea380c99a91e12ef6ad7574f
Message:

Support for different point shapes

Location:
orange/OrangeWidgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Graph/curve.py

    r8296 r8298  
    7979        elif self.style.point_shape is SquareShape: 
    8080            i = QGraphicsRectItem(x-s/2, y-s/2, s, s, parent) 
     81        elif self.style.point_shape is EllipseShape: 
     82            i = QGraphicsEllipseItem(x-s/2, y-s/2, 1.5*s, 0.8*s, parent) 
     83        else: 
     84            i = QGraphicsRectItem(x-s/2, y-s/2, 1.5*s, 0.8*s, parent) 
    8185        i.setPen(QPen(Qt.NoPen)) 
    8286        i.setBrush(self.brush) 
  • orange/OrangeWidgets/OWGraphQt.py

    r8297 r8298  
    249249         
    250250    def addCurve(self, name, brushColor = Qt.black, penColor = Qt.black, size = 5, style = Qt.NoPen,  
    251                  symbol = palette.EllipseShape, enableLegend = 0, xData = [], yData = [], showFilledSymbols = None, 
     251                 symbol = palette.CircleShape, enableLegend = 0, xData = [], yData = [], showFilledSymbols = None, 
    252252                 lineWidth = 1, pen = None, autoScale = 0, antiAlias = None, penAlpha = 255, brushAlpha = 255): 
    253253        data = [] 
    254254        qDebug('Adding curve ' + name + ' with ' + str(len(xData)) + ' points' + (' to legend' if enableLegend else '')) 
     255        qDebug('Its shape is ' +str(symbol) ) 
    255256        for i in range(len(xData)): 
    256257            data.append( (xData[i], yData[i]) ) 
    257         c = curve.Curve(name, data, self.palette.line_style(len(self.curves)), self) 
     258         
     259        line_style = palette.LineStyle(brushColor, lineWidth, style, symbol, size) 
     260         
     261        c = curve.Curve(name, data, line_style, self) 
    258262        c.setPos(self.graph_area.bottomLeft()) 
    259263        c.continuous = (style is not Qt.NoPen) 
Note: See TracChangeset for help on using the changeset viewer.