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

  • Home
  • SEARCH
  • 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 6125153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:12:53+00:00 2026-05-23T16:12:53+00:00

I am trying to plot some data in Flot that should display x-axis in

  • 0

I am trying to plot some data in Flot that should display x-axis in time mode. The flot reference API doesn’t indicate that minTickSize can accept “week” as a unit, so I have specified the unit as “day” with value of 7:

  minTickSize: [7, "day"],

This displays the tick size as 7 days apart in some ticks and about 8-9 days apart in some ticks. Here is an example showing the inconsistent ticks: http://jsfiddle.net/UEePE/583/

I know that the chart is also not plotting the simple line I am expecting. Still working on trying to figure out why. When I remove all options from xaxis except the mode:time, then it seems to work, but not when I add the other options.

Any help would be appreciated on how to make Flot add ticks 7 days/1 week apart and how to make the chart actually plot a line in this case.

Thank you!

  • 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-23T16:12:54+00:00Added an answer on May 23, 2026 at 4:12 pm

    First up. Flot’s data argument is an array of series. Each series is an array of points, each point is an array of two values: x and y. So your data should look like:

    var data = [ [
        [1301634000000, 315.71], //Apr 1, 2011
        [1302238800000, 209.21], //Apr 8, 2011
        [1302843600000, 420.36], //Apr 15
        [1303448400000, 189.86], //4/22
        [1304053200000, 314.93], //4/29
        [1304658000000, 279.71], //5/6
        [1305262800000, 313.34], //5/13
        [1305867600000, 114.67], //5/20
        [1306472400000, 315.58] //5/27
    ] ];
    

    Next Flot is converting your [7, “day”] to [0.25, “month”]. There are only so many values for minTickSize it’ll accept (search for “spec” in the source code).

    That means you will have to supply the tick values yourself. The easy way is to take your x-axis values from your first data series, create a ticks array, and pass that in to the xaxis hash:

    var ticks = [];
    for (var i = 0; i < data[0].length; i++) {
      ticks.push(data[0][i][0]); //corrected the missing closing bracket here..
    }
    

    Then

    $.plot($("#placeholder"), data, {
      xaxis: {
        mode: "time",
        ticks: ticks,
        timeformat: "%m/%d",
        min: (new Date(2011, 2, 31)).getTime(),
        max: (new Date(2011, 4, 31)).getTime()
      },
      ..etc..  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data set that I am trying to plot with ggplot2,
I have the following problem when trying to plot some 3D data in Mathematica.
I'm using GD to plot some simple charts from array point data.. Trying to
I've run into a bit of a hiccup trying to plot some data in
Trying to find some simple SQL Server PIVOT examples. Most of the examples that
I am trying to make an asynchronous request to get some data from my
I am trying to plot a bunch of data points (many thousands) in Python
We are looking to do display some mathematical data in a Flex GUI chart.
I'm very new to MATLAB and I was trying to display a real time
I'm trying to plot a log-log graph that shows logarithmically spaced grid lines at

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.