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 8063045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:53:22+00:00 2026-06-05T10:53:22+00:00

I am using the excellent jqPlot plug-in, and the only feature that I didn’t

  • 0

I am using the excellent jqPlot plug-in, and the only feature that I didn’t find in the documentation is “how to color parts of background / grid with several different colors”

The x-axis units of my graphs are dates. I would like to highlight the weekend part (only) of the grid by changing the background grid color if it is possible.

Or anyone would have another idea?

Thanks

EDIT WITH FINAL ANSWER

Based on the Boro’s suggestion, I developed a better way to highlight a part of the background using the “line” option instead of “verticalLine” option. The fact is that with “verticalLine”, developers must deal with the line width.So, it is difficult to obtain what you need because the width of the line spreads from the centre of the line and not from a border.

“Line” option permits to set a start and end points to set the exact part of the background to highlight. The width parameter is still used to display the line as a column, but it spread horizontally, not vertically.

About the “lineWidth” properties, the value is defined in pixel. Therefore, you can set the value with the graph container height to be sure and set the “y” value of the “start” and “end” properties with an average of your series data or an approximate middle range of your yaxis.

I updated the Boro’s fiddle here

                grid:                 
                {
                    drawGridLines: true,        // wether to draw lines across the grid or not.
                    gridLineColor: '#cccccc',   // Color of the grid lines.
                    backgroundColor: "#eee",
                    borderColor: '#999999',     // CSS color spec for border around grid.
                    borderWidth: 2.0,           // pixel width of border around grid.
                    shadow: true,               // draw a shadow for grid.
                    shadowAngle: 45,            // angle of the shadow.  Clockwise from x axis.
                    shadowOffset: 1.5,          // offset from the line of the shadow.
                    shadowWidth: 3,             // width of the stroke for the shadow.
                    shadowDepth: 3,             // Number of strokes to make when drawing shadow.
                                                // Each stroke offset by shadowOffset from the last.
                    shadowAlpha: 0.07,          // Opacity of the shadow
                },
                canvasOverlay: {
                    show: true,
                    objects:

                            [
                                {
                                    line:
                                    {
                                        start : [new Date('2012-01-12').getTime(),20],                                                
                                        stop : [new Date('2012-01-13').getTime(),20],                                                
                                        lineWidth: 1000,
                                        color: 'rgba(255, 0, 0,0.45)',
                                        shadow: false,
                                        lineCap : 'butt'
                                    }
                                },                                    
                                {
                                    line:
                                    {
                                        start : [new Date('2012-01-13').getTime(),20],                                                
                                        stop : [new Date('2012-01-14').getTime(),20],                                                
                                        lineWidth: 1000,
                                        color: 'rgba(255, 0, 0,0.45)',
                                        shadow: false,
                                        lineCap : 'butt'
                                    }
                                }
                            ]
                }                    

Result sample

  • 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-06-05T10:53:24+00:00Added an answer on June 5, 2026 at 10:53 am

    I think the sample shown by @Katya in the code under my answer to a related problem maight be helpful for you.

    Direct link to the sample.

    EDIT

    With regards to the second part you would need to use a verticalLine and set its x value as milliseconds, as presented here. Then you need to worry about selecting appropriate lineWidth.

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

Sidebar

Related Questions

So I'm using the excellent Ancestry gem But while the documentation seems very complete
I'm using the excellent DuplexHttpBinding . I now want to extend it so that
I've been using the--quite excellent--playframework and have had trouble finding documentation/examples on how to
I am using the excellent jQuery MultiSelect plugin. The problem I have is that
Our Swing application performs some long-running tasks in a background thread using the excellent
I am considering using the excellent looking Cocos2d for a motion graphics project. However,
I am using the excellent jTemplates plugin to generate content. Given a data object
I'm using the excellent Sprint.ly to manage my project. I'm using git for source
I have been using this excellent decorator for memoization, which I found on the
I'm using the excellent Nivoslider plugin to showcase a set of photos on my

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.