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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:09:33+00:00 2026-06-02T08:09:33+00:00

Tell me if anyone encountered this problem: I show on my page plot using

  • 0

Tell me if anyone encountered this problem:

I show on my page plot using jqPlot

<script language="javascript" type="text/javascript">

    $(document).ready(function () {
            $.jqplot.config.enablePlugins = true;
            var chLines = [[['09/30/2010 00:00:00',24.13],['12/31/2010 00:00:00',28.26],['03/31/2011 00:00:00',24.00],['06/30/2011 00:00:00',25.35],['09/30/2011 00:00:00',26.26],['12/31/2011 00:00:00',29.71]]];
            var chSeries = [{       color: '#436277',       label: 'label'  }];
        var mnth;
        var quarter;

        $.jqplot.DateTickFormatter = function(format, val) {
            if (!format) {
                format = '%Y/%m/%d';
            }       

            if(format == '%Q') {
                mnth = $.jsDate.strftime(val, '%#m');
                quarter = parseInt((mnth-1) / 3) + 1;
                return $.jsDate.strftime(val, '%Y') + 'Q' + quarter;
            }
            return $.jsDate.strftime(val, format);
        };

        //$.jqplot.DateAxisRenderer.tickInterval = 86400000*32*3;

        var plot = $.jqplot('content-chart', chLines,
            {
                //animate: !$.jqplot.use_excanvas, // Only animate if we're not using excanvas (not in IE 7 or IE 8)..           
                axes: {
                    xaxis: {
                        tickInterval: 86400000*32*3,
                        renderer: $.jqplot.DateAxisRenderer,
                        borderColor: 'black',
                        borderWidth: 0.5,
                        tickOptions: {
                            showGridline: false,
                            //formatString: '%b %Y',
                            formatString: '%Q',
                            textColor: 'black',
                            fontSize: '11px',
                        }
                    },
                    yaxis: {
                        min: 0,
                        tickOptions: {
                            formatString: '%.2f',
                            textColor: 'black',
                            fontSize: '11px'
                        }
                    }
                },
                highlighter: {
                    show: true,
                    sizeAdjust: 7.5
                },
                seriesDefaults: {
                    lineWidth: 3
                },

                series: chSeries,
                legend: {
                    show: true,
                    location: 'sw',//compass direction, nw, n, ne, e, se, s, sw, w.
                    xoffset: 5,
                    yoffset: 5
                    //placement: 'outside'
                },

                grid:{
                    background: 'white',
                    borderColor: 'white',
                    shadow: false,
                    gridLineColor: '#999999'
                }
            });
            $(window).bind('resize', function(event, ui) {              
                plot.replot( { resetAxes: true } );
            });
    });
</script>

I see that the tick labels are duplicated on the X axis enter image description here

but when window are resized this.tickInterval object in the jqplot.dateAxisRenderer.js in createTicks function become is null. Also I tried to change code in the function createTicks looks like this

this.tickInterval = 86400000 * 32 * 3;
var tickInterval = this.tickInterval;

but unfortunately the tick labels are beginning to run into each other when the window is resized.

  • 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-02T08:09:36+00:00Added an answer on June 2, 2026 at 8:09 am

    To sort out your problem you must first set the ‘min’ and ‘max’ dates for the date axis (i.e. axis X). Apparently only when the ‘min’ and ‘max’ values are set the renderer will use the value of ‘tickInterval’. That sort of problem was actually already solved on stack — please see this answer.

    Therefore using this suggestion you will need to set the following parameters as below:

    tickInterval: "3 months",   
    min: chLines[0][0][0],
    max: chLines[0][0][chLines[0].length-1]
    

    As it goes for the resizing bit you need to use the below:

    $(window).bind('resize', function(event, ui) {    
        if (plot) {
            plot.replot();
        }
    });
    

    Here is a working code sample made for your code.


    EDIT:
    After fiddling with the sample for a while I observed that there was still a little bit of a problem thought not visible cause the format was covering it. As it appears the setting of min, max and tickInterval is not enough as the values are still not every 3 months as each tick shows 30th day and it should sometimes be 31.

    The only solution then I figured out was to set the ticks myself. In this case you do not need min, max and tickInterval any more.

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

Sidebar

Related Questions

Can anyone tell me why this isn't working for me? Example page here http://totalcommunitycollegemove.com/post-438.html
Can anyone tell me why this coffee script: $ -> $('#btnLogin').live 'click', -> $.ajax
Can anyone tell me why ActionScript 3, a statically typed language, doesn't have generics?
Can anyone tell me what's wrong with this code? class Dataset < ActiveRecord::Base has_many
Can anyone tell me how to write and run msbuild by using VS 2005?
Can anyone tell me how to calculate the diff between two dates without using
Can anyone tell me how to open Auto CAD file in HTML5? Is this
Can anyone tell me why this code would throw an undefined is not a
Can anyone tell me why this c# console command not running on Java? I've
I was writing this code in C when I encountered the following problem. #include

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.