Good I have the following doubt I am doing a function to return a pdf with a graph I am doing with ReportLab my question is the following as I indicate to the canvas that I paint my graph and return it in the pdf generated now it returns the pdf in white here I leave my code
response = HttpResponse(content_type='application/pdf')
nombre_pdf = oficina + piso
nombre_pdf = get_valid_filename(nombre_pdf)
response['Content-Disposition'] = 'attachment; filename=' + nombre_pdf
buffer = BytesIO () p = canvas.Canvas (buffer)
from reportlab.lib.colors import PCMYKColor
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.charts.barcharts import VerticalBarChart
d = Drawing(280, 250)
bar = VerticalBarChart()
bar.x = 50
bar.y = 85
data = [[1,2,3,None,None,None,5],
[10,5,2,6,8,3,5],
[5,7,2,8,8,2,5],
[2,10,2,1,8,9,5],
]
bar.data = data
bar.categoryAxis.categoryNames = ['Year1', 'Year2', 'Year3',
'Year4', 'Year5', 'Year6',
'Year7']
bar.bars[0].fillColor = PCMYKColor(0,100,100,40,alpha=85)
bar.bars[1].fillColor = PCMYKColor(23,51,0,4,alpha=85)
bar.bars.fillColor = PCMYKColor(100,0,90,50,alpha=85)
d.add(bar, '')