Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6997503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:17:29+00:00 2026-05-27T20:17:29+00:00

I am using Reportlab to create some graphs in my PDF reports. I was

  • 0

I am using Reportlab to create some graphs in my PDF reports. I was creating an Area Line Plot and got stuck at a point where I am not able to understand why am I not getting the output I would like to see.

Here is the code I had written for my output:

def standardLinePlot(data, width=200, height=200):

    d = Drawing(width, height)
    lp = AreaLinePlot()
    lp.data=data
    lp.width, lp.height = width, height
    lp.xValueAxis.valueMin = 0
    lp.xValueAxis.valueMax =36
    lp.xValueAxis.valueSteps = [0,6,12,18,24,30,36]

    lp.yValueAxis.valueMin = 0
    lp.yValueAxis.valueMax =100

    lp.strokeColor=colors.black
    lp.fillColor=colors.grey

    lp.reversePlotOrder = False

    lp.joinedLines=1

    d.add(lp)

    return d

The output I am getting is:

Area Line Plot

My intended output is that grey color should be in place of red color which is the area under the line plot. The other problem is how can I add the axis title to this chart. For example, I need “Months” to be my X axis and “% of NAV” to be my Y axis.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:17:30+00:00Added an answer on May 27, 2026 at 8:17 pm

    To define the color for the lines it seems you need to access… well, the lines :). So, lp.lines[0].strokeColor = colors.grey instead of lp.strokeColor = colors.grey, as that one goes for the plot background color!

    The question about the labels is a bit more tricky, though… ScatterPlot includes functionality to set labels for X and Y axis, but that’s not the case for AreaLinePlot. Of course, you could derive a class from AreaLinePlot copying that functionality, if you’re going to use it often.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m using django and reportlab tool generate Dynamic PDF reports. All the data in
Can we create interactive PDF forms using reportlab? That is, a form that takes
I'm using Reportlab to create PDFs. I'm creating two PDFs which I want to
I'm generating some pdf's with Reportlab and Django using a web interface. The pdf's
I'm preparing a set of reports using open source ReportLab. The reports contain a
I´m using Reportlab to generate a PDF. Can´t retrieve a photo from a model.
I am using reportlab in python to render a pdf server side. I really
I'm writing a python script to generate PDF using ReportLab. So whenever i made
Is it possible to generate a PDF file using ReportLab in such a way
I'm building a pdf document with reportlab, using the Paragraph class: doc = SimpleDocTemplate(response,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.