Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
Flot Charts with xasis Time

I am trying a flot charts with data
[[1645570986, 0.4624863055203449], [1645570987, 0.4624863055203449], [1645570988, 0.468952235505014],…]
therefore [timespamp, value], however, the time does not appear in the x axis. Anyone can give me some advice.

function CF_real_CPU(){

'use strict';
var cpu = $.plot('#flotRealtime1', [real[0].data], {
    colors: ['#ff5e5e'],
    series: {
        lines: {
            show: true,
            lineWidth: 1
        },
        shadowSize: 0 // Drawing is faster without shadows
    },
    grid: {
        borderColor: 'transparent',
        borderWidth: 1,
        labelMargin: 5
    },
    xaxis: {
        mode: "time",
    tickSize: [10, "second"],
    tickLength: 10,
    axisLabelUseCanvas: true,
    axisLabelPadding: 10,
        color: "transparent",
        font: {
            size: 10,
            color: "#fff"
        }
    },
    yaxis: {
        color: 'transparent',
        font: {
            size: 10,
            color: '#fff'
        }
    }
});

}

image charts

Thank you
alby696

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your timestamp are in seconds. When using Flot (and JavaScript in general) they need to be in milliseconds. 1645570987 needs to be 1645570987000 and so on.

With the timestamps as they are now, all your data spans less than one second, so the time on the axis is outside the vissible area.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!