Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Date-Time on x-axis of ZingChart

I want to plot date-time vs an integer. I tried Date(year,month,day,hours,minutes,seconds) but it is not supporting it. So is it possible to plot date-time on x-axis by using zingChart?

like image 250
Marium Malik Avatar asked Jan 07 '23 22:01

Marium Malik


1 Answers

For displaying dates, you can use the transform attribute on your scale-x. It allows you to format your Unix timestamp however you want. Here's an example.

"scale-x":{
  "transform":{
    "type":"date",
    "all":"%d %M, %h:%i %A"
  }
}

You can see the rendered chart here

Here's a link to the docs on the ZingChart site for date-time transformation. I'm on the ZingChart team. Holler if you have more questions.

like image 170
Patrick RoDee Avatar answered Jan 25 '23 06:01

Patrick RoDee