Home forums Using CanvasJS datetime format

This topic contains 4 replies, has 4 voices, and was last updated by  Priyanka M S 2 months, 3 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6297

    Daniel Silva
    Participant

    Hi,

    Currently the only way I found to send datetime x values from PHP to canvasjs is converting all in PHP to timeStamps.
    Is possible to use other format like ‘yyyy-mm-dd’ or ‘yyyy-mm-dd hh:mm’?
    Something like:

    xValueType: “dateTime”,
    xValueFormat:”YYYY-MM-DD”,

    Br,
    Daniel

    • This topic was modified 4 years, 3 months ago by  Daniel Silva.
    • This topic was modified 4 years, 3 months ago by  Daniel Silva.
    #6300

    Sunil Urs
    Keymaster

    As of now only timestamps or date objects can be assigned to x. Other formats are not supported yet.


    Sunil Urs

    #6302

    Daniel Silva
    Participant

    Ok, I can work with that.
    thanks

    #20878

    samira.2018
    Member

    Hello
    I hope you’re fine
    I store the received data in a file data base as follows:
    [“0.4″,”0.4″,”0.5″,”0.43”,1522731408]
    [“0.3″,”0.3″,”0.3″,”0.39”,1522731468]
    [“0.3″,”0.3″,”0.3″,”0.33”,1522731529]
    [“0.2″,”0.2″,”0.2″,”0.25”,1522731590]
    [“0.1″,”0.1″,”0.1″,”0.2”,1522731650]
    [“0.1″,”0.1″,”0.0″,”0.15”,1522731711]
    [“0.1″,”0.0″,”0.0″,”0.12”,1522731771]
    [“0.0″,”0.0″,”0.0″,”0.09”,1522731832]
    [“0.2″,”0.0″,”0.0″,”0.08”,1522731892]
    [“0.1″,”0.0″,”0.0″,”0.07”,1522731953]
    [“0.0″,”0.0″,”0.0″,”0.06”,1522732013]
    [“0.1″,”0.0″,”0.1″,”0.06”,1522732074]
    [“0.1″,”0.0″,”0.0″,”0.06”,1522732135]
    [“0.0″,”0.1″,”0.2″,”0.05”,1522732195]
    [“0.0″,”0.0″,”0.0″,”0.05”,1522732256]
    [“0.1″,”0.0″,”0.0″,”0.06”,1522732316]
    [“0.1″,”0.0″,”0.0″,”0.05”,1522732377]
    [“0.1″,”0.0″,”0.1″,”0.04”,1522732437]
    [“0.0″,”0.0″,”0.1″,”0.03”,1522732498]
    [“0.1″,”0.0″,”0.1″,”0.03”,1522732559]
    [“0.1″,”0.0″,”0.0″,”0.04”,1522732619]

    The first four are the data, and the last number is the timestamps

    Now I do not need past information
    And I want to erase the previous day’s information
    How should I do this?
    Can you give us an exact example?
    thank you

    #20898

    Priyanka M S
    Member

    @samira.2018

    You can eliminate the past information by comparing timestamps of individual dataPoints against the current time. Please take a look at this fiddle.

    __
    Priyanka M S
    Team CanvasJS

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.