當前位置: 首頁>>代碼示例>>Python>>正文


Python Line.strokeWidth方法代碼示例

本文整理匯總了Python中reportlab.graphics.shapes.Line.strokeWidth方法的典型用法代碼示例。如果您正苦於以下問題:Python Line.strokeWidth方法的具體用法?Python Line.strokeWidth怎麽用?Python Line.strokeWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在reportlab.graphics.shapes.Line的用法示例。


在下文中一共展示了Line.strokeWidth方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: makeSwatchSample

# 需要導入模塊: from reportlab.graphics.shapes import Line [as 別名]
# 或者: from reportlab.graphics.shapes.Line import strokeWidth [as 別名]
    def makeSwatchSample(self,rowNo, x, y, width, height):
        baseStyle = self.lines
        styleIdx = rowNo % len(baseStyle)
        style = baseStyle[styleIdx]
        color = style.strokeColor
        y = y+height/2.
        if self.joinedLines:
            dash = getattr(style, 'strokeDashArray', getattr(baseStyle,'strokeDashArray',None))
            strokeWidth= getattr(style, 'strokeWidth', getattr(style, 'strokeWidth',None))
            L = Line(x,y,x+width,y,strokeColor=color,strokeLineCap=0)
            if strokeWidth: L.strokeWidth = strokeWidth
            if dash: L.strokeDashArray = dash
        else:
            L = None

        if hasattr(style, 'symbol'):
            S = style.symbol
        elif hasattr(baseStyle, 'symbol'):
            S = baseStyle.symbol
        else:
            S = None

        if S: S = uSymbol2Symbol(S,x+width/2.,y,color)
        if S and L:
            g = Group()
            g.add(L)
            g.add(S)
            return g
        return S or L
開發者ID:wolf29,項目名稱:EG-notifications,代碼行數:31,代碼來源:linecharts.py

示例2: makeSwatchSample

# 需要導入模塊: from reportlab.graphics.shapes import Line [as 別名]
# 或者: from reportlab.graphics.shapes.Line import strokeWidth [as 別名]
    def makeSwatchSample(self,rowNo, x, y, width, height):
        styleCount = len(self.lines)
        styleIdx = rowNo % styleCount
        rowColor = self.lines[styleIdx].strokeColor

        if self.joinedLines:
            dash = getattr(self.lines[styleIdx], 'strokeDashArray', getattr(self.lines,'strokeDashArray',None))
            strokeWidth= getattr(self.lines[styleIdx], 'strokeWidth', getattr(self.lines[styleIdx], 'strokeWidth',None))
            L = Line(x,y,x+width,y+height,strokeColor=rowColor,strokeLineCap=0)
            if strokeWidth: L.strokeWidth = strokeWidth
            if dash: L.strokeDashArray = dash
        else:
            L = None

        if hasattr(self.lines[styleIdx], 'symbol'):
            S = self.lines[styleIdx].symbol
        elif hasattr(self.lines, 'symbol'):
            S = self.lines.symbol
        else:
            S = None

        if S: S = uSymbol2Symbol(S,x+width/2.,y+height/2.,rowColor)
        if S and L:
            g = Group()
            g.add(S)
            g.add(L)
            return g
        return S or L
開發者ID:eaudeweb,項目名稱:naaya,代碼行數:30,代碼來源:lineplots.py

示例3: makeInnerLines

# 需要導入模塊: from reportlab.graphics.shapes import Line [as 別名]
# 或者: from reportlab.graphics.shapes.Line import strokeWidth [as 別名]
    def makeInnerLines(self):
        # inner grid lines
        group = Group()

        w, h = self.width, self.height

        if self.useLines == 1:
            if self.orientation == 'vertical':
                r = self.makeLinePosList(self.x, isX=1)
                for x in r:
                    line = Line(x, self.y, x, self.y + h)
                    line.strokeColor = self.strokeColor
                    line.strokeWidth = self.strokeWidth
                    group.add(line)
            elif self.orientation == 'horizontal':
                r = self.makeLinePosList(self.y, isX=0)
                for y in r:
                    line = Line(self.x, y, self.x + w, y)
                    line.strokeColor = self.strokeColor
                    line.strokeWidth = self.strokeWidth
                    group.add(line)

        return group
開發者ID:halimath,項目名稱:taskcardmaker,代碼行數:25,代碼來源:grids.py

示例4: draw

# 需要導入模塊: from reportlab.graphics.shapes import Line [as 別名]
# 或者: from reportlab.graphics.shapes.Line import strokeWidth [as 別名]
 def draw(self):
     l = Line(self.x,self.y,self.x+self.width,self.y)
     l.strokeColor = self.strokeColor
     l.strokeDashArray  = self.strokeDashArray
     l.strokeWidth = self.height
     return l
開發者ID:Distrotech,項目名稱:reportlab,代碼行數:8,代碼來源:legends.py


注:本文中的reportlab.graphics.shapes.Line.strokeWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。