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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:25:34+00:00 2026-06-14T20:25:34+00:00

I am using Flot Graph Api to plot graphs, I want to plot time

  • 0

I am using Flot Graph Api to plot graphs, I want to plot time values in bar charts.

My table look like some thing similar to this

enter image description here

My X-Axis should be list of Reasons and Y-Axis should be time variables. My Graph should be some thing like this.

enter image description here

but i get something like this, because of the Json object is packed wrongly.

enter image description here

How to plot graph for time values in

My plot JS code is

    <script language="javascript" type="text/javascript">  
$(document).ready(function(){
$.getJSON('ReasonByTime.txt', function(json) {
   //succes - data loaded, now use plot:
       var plotarea = $("#placeholder");
       var dataBar=json.data;
        $.plot(plotarea , [
            {
                data: dataBar,
                bars: { show: true},
                legend: {show: true},
                yaxis: {
                    mode: 'time',
                    timeformat: "%y/%m/%d",
                        min: ( new Date('2012/01/01') ).getTime(),
                        max: ( new Date('2020/01/01') ).getTime(), 
                        minTickSize: [1, 'hour']
                }
            }          
        ]
    );
});

});

and my current Json object is like this.

  {"data":[[0,5202],[0,19620],[0,82920],[0,240],[0,75720],[0,3060],[0,72840]],"label":"Tea break"}

Since i’m new to flot i’m struck up with this work, i did some research but i can’t able to solve my problem. Can someone help me out.

  • 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-14T20:25:37+00:00Added an answer on June 14, 2026 at 8:25 pm

    Thanks to DNS, the problem is the all my x-axis values are zero, so i changed my JSON in the following format,

      [{"data":[[0,5202]],"label":"Over Time"},{"data":[[1,19620]],"label":"Shift Start"},{"data":[[2,82920]],"label":"Maintenance break"},{"data":[[3,240]],"label":"Lunch break"},{"data":[[4,75720]],"label":"BreakDown"},{"data":[[5,3060]],"label":"Break"},{"data":[[6,72840]],"label":"Tea break"},{"data":[[6,79260]],"label":"Power Failure"}]
    

    Now i get my graph like this,

    enter image description here

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

Sidebar

Related Questions

I am using flot to generate bar graphs. Here is my code bar graph
I am using flot to create bar charts like I need to specify a
I'm using Flot Graph Api to display bar chart, line chart in my clien
Okay to get started I am using Jquery-Flot to plot a radial graph I
I am using jQuery/FLOT to draw a graph, I would like for the user
I am having problem with flot library to plot a graph using its line
Using Flot to show some graphs. Out of the blue the website started to
I'm using Flot to plot a line graph and my data set is a
I'm using Flot and would like to associate text with each individual plot point
I am using flot to display a bar graph. Due to the long label

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.