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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:52:19+00:00 2026-06-18T00:52:19+00:00

I am using jqplot and dateAxisRenderer to display a line chart with date labels

  • 0

I am using jqplot and dateAxisRenderer to display a line chart with date labels on the x-axis. However, I need to update that plot regularly with new data. When calling replot, the plot does not change as the below example demonstrates. Any suggestions?

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
         <script type="text/javascript" src="../jquery/ui/1.9.2/custom/js/jquery-1.8.3.js"></script>

        <script type="text/javascript" src="../jquery/plugins/jqplot/dist/jquery.jqplot.js"></script> 
        <script type="text/javascript" src="../jquery/plugins/jqplot/dist/plugins/jqplot.dateAxisRenderer.js"></script>
        <script type="text/javascript" src="../jquery/plugins/jqplot/dist/plugins/jqplot.canvasTextRenderer.js"></script>
        <script type="text/javascript" src="../jquery/plugins/jqplot/dist/plugins/jqplot.canvasAxisTickRenderer.js"></script>
        <script type="text/javascript" src="../jquery/plugins/jqplot/dist/plugins/jqplot.AxisLabelRenderer.js"></script>
        <script type="text/javascript" src="../jquery/plugins/jqplot/dist/plugins/jqplot.categoryAxisRenderer.js"></script>
        <script type="text/javascript" src="../jquery/plugins/jqplot/dist/plugins/jqplot.barRenderer.js"></script>
        <script type="text/javascript" src="../jquery/plugins/jqplot/dist/plugins/jqplot.enhancedLegendRenderer.js"></script>

        <link rel="stylesheet" type="text/css" href="../jquery/plugins/jqplot/dist/jquery.jqplot.css" />
    </head>

    <body>
        <div id="chartdiv" style="height:400px;width:800px;"></div>

        <script type="text/javascript">
            $(document).ready(function(){
                var line1 = [
                    [new $.jsDate("2013-01-28 1:10PM"), 1.0],
                    [new $.jsDate("2013-01-28 1:11PM"), 2.0],
                    [new $.jsDate("2013-01-28 1:12PM"), 4.0],
                    [new $.jsDate("2013-01-28 1:13PM"), 8.0],
                    [new $.jsDate("2013-01-28 1:14PM"), 16.0],
                    [new $.jsDate("2013-01-28 1:15PM"), 32.0]
                ];
                var plot2 = $.jqplot('chartdiv', [line1] ,{
                    series:[{lineWidth:4, showMarker:false, renderer:$.jqplot.LineRenderer}],
                    axesDefaults: {
                        tickRenderer: $.jqplot.CanvasAxisTickRenderer
                    },
                    axes:{
                        xaxis:{
                            renderer:$.jqplot.CategoryAxisRenderer,
                                tickOptions:{
                                    formatString:'%F %X',
                                    angle: -30
                                }
                        },
                    }
                });

                alert("wait");
                line1 = [
                    [new $.jsDate("2013-01-28 1:10PM"), 32.0],
                    [new $.jsDate("2013-01-28 1:11PM"), 16.0],
                    [new $.jsDate("2013-01-28 1:12PM"), 8.0],
                    [new $.jsDate("2013-01-28 1:13PM"), 4.0],
                    [new $.jsDate("2013-01-28 1:14PM"), 2.0],
                    [new $.jsDate("2013-01-28 1:15PM"), 1.0]
                ];
                plot2.data = [line1];
                plot2.replot({resetAxes:true});
            });
        </script>
    </body>
</html>
  • 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-18T00:52:20+00:00Added an answer on June 18, 2026 at 12:52 am

    I have done some work with jqplot recently and find the inconsistencies in the data handling a bit frustrating.

    Given your example of plot2: For a bar chart you have to look at plot2.series[i].data not plot2.data and then replot() it (ref: http://www.jqplot.com/deploy/dist/examples/selectorSyntax.html)

    e.g. for your code

                ...
                plot2.series[0].data = [line1];
                plot2.replot({resetAxes:true});
                ...
    

    I’ve tried to abstract the nuances for the different chart types but until then I have been abstracting it by storing the data on a parent object, destroying the plot and then redoing the plot using $.jqplot(e, data,options)

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

Sidebar

Related Questions

I've just started using JqPlot and want to display a small chart However there
I am using jqplot to plot line graphs with dates in x axis ..
i'm using jqplot 1.0.0b1_r746. i want to display some time periods using the date
I am trying to display bar chart using jqPlot bar chart. I have doing
When using a theme in jqPlot the x axis labels are disappeared. The colors
I am using jqPlot with DateAxisRenderer to display graphs of various functions of time.
I tried to plot data useage per day using jqPlot along with its DateAxisRenderer
I'm using jqplot for displaying bar chart and pie chart. I want to display
I'm using jqPlot with jqplot.PieRenderer to try and display a pie chart. On the
I'm using jqplot to draw a simple bar chart however only half of the

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.