本文整理汇总了Python中reportlab.graphics.charts.barcharts.VerticalBarChart.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Python VerticalBarChart.getProperties方法的具体用法?Python VerticalBarChart.getProperties怎么用?Python VerticalBarChart.getProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reportlab.graphics.charts.barcharts.VerticalBarChart
的用法示例。
在下文中一共展示了VerticalBarChart.getProperties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reporte4_pdf
# 需要导入模块: from reportlab.graphics.charts.barcharts import VerticalBarChart [as 别名]
# 或者: from reportlab.graphics.charts.barcharts.VerticalBarChart import getProperties [as 别名]
def reporte4_pdf(request, pk_proyecto):
from reportlab.graphics.shapes import Drawing, Rect, String, Group, Line
from reportlab.graphics.charts.barcharts import VerticalBarChart
proy = Proyecto.objects.get(id=pk_proyecto)
story = []
estilo = getSampleStyleSheet()
import pprint
estiloHoja = getSampleStyleSheet()
cabecera = estiloHoja['Heading2']
cabecera.pageBreakBefore = 0
cabecera.keepWithNext = 0
cabecera.backColor = colors.white
cabecera.spaceAfter = 0
cabecera.spaceBefore = 0
parrafo = Paragraph('', cabecera)
story.append(parrafo)
parrafo = Paragraph('CUARTO INFORME DEL' + '"' + proy.nombre_largo + '" : ', cabecera)
story.append(parrafo)
parrafo = Paragraph('_' * 66, cabecera)
story.append(parrafo)
cabecera2 = estiloHoja['Heading2']
cabecera2.pageBreakBefore = 0
cabecera2.keepWithNext = 0
cabecera2.backColor = colors.white
parrafo = Paragraph(
'GRAFICO DE TIEMPO ESTIMADO Y EJECUTADO POR SPRINT DEL PROYECTO' + '"' + proy.nombre_largo + '"', cabecera2)
story.append(parrafo)
d = Drawing(400, 200)
sprints = Sprint.objects.filter(proyecto=proy)
print sprints
listasprint = []
listaplan = []
listaejec = []
for sp in sprints:
listasprint.append(sp.nombre)
US = UserStory.objects.filter(sprint=sp)
print US
tarea = Tarea.objects.filter(user_story_id= US)
totalus = 0
sumatarea = 0
for u in US:
totalus += u.estimacion
for t in tarea:
sumatarea += t.horas_de_trabajo
listaejec.append(totalus)
listaplan.append(sumatarea)
mayor = 0
for j in listaejec:
if j > mayor:
mayor = j
for j in listaplan:
if j > mayor:
mayor = j
data = [listaplan, listaejec]
bc = VerticalBarChart()
bc.x = 50
bc.y = 50
bc.height = 125
bc.width = 300
bc.data = data
bc.strokeColor = colors.black
bc.valueAxis.valueMin = 0
bc.valueAxis.valueMax = mayor + 10
bc.valueAxis.valueStep = 10 #paso de distancia entre punto y punto
bc.categoryAxis.labels.boxAnchor = 'ne'
bc.categoryAxis.labels.dx = 8
bc.categoryAxis.labels.dy = -2
bc.categoryAxis.labels.angle = 30
bc.categoryAxis.categoryNames = listasprint
bc.groupSpacing = 10
bc.barSpacing = 2
d.add(bc)
pprint.pprint(bc.getProperties())
story.append(d)
cabecera2 = estiloHoja['Heading2']
cabecera2.pageBreakBefore = 0
cabecera2.keepWithNext = 0
cabecera2.backColor = colors.white
parrafo = Paragraph('ROJO = TIEMPO ESTIMADO', cabecera2)
story.append(parrafo)
cabecera2 = estiloHoja['Heading2']
cabecera2.pageBreakBefore = 0
cabecera2.keepWithNext = 0
cabecera2.backColor = colors.white
parrafo = Paragraph('VERDE = TIEMPO EJECUTADO', cabecera2)
story.append(parrafo)
story.append(Spacer(0, 20))
parrafo = Paragraph('_' * 66, cabecera)
story.append(parrafo)
#parrafo = Paragraph('FIN DE CUARTO INFORME' + ' ' * 100 + '(' + str(datetime.date.today()) + ')', cabecera)
#.........这里部分代码省略.........