Dates on x-axis of chart

I'm trying to plot timeseries data on a line chart. Data was collected over a two-week period at irregular intervals. There are gaps (periods when no data was collected) and I want the line to break during those gaps so that it is clearly visible when no data was collected. Timestamps are Unix time with milliseconds. I'd like the x-axis of my Webix chart to be labeled in human-readable dates. Have tried with the Custom X Axis Formation article (https://docs.webix.com/desktop__custom_x_axis.html) but can't get it to work. I can get an unbroken line, but I can't get the X Axis to recognize the timestamp as an actual date and show the outages.

Any help greatly appreciated.

My data looks like this:
[{timestamp: 1593906288113, index: 0, temperature: -0, humanTs: "2020-07-04 19:44:48"},
{timestamp: 1593918384339, index: 1, temperature: 0, humanTs: "2020-07-04 23:06:24"},
{timestamp: 1593930480565, index: 2, temperature: -0, humanTs: "2020-07-05 02:28:00"},
//
//(...94 more readings here...)
//
{timestamp: 1595079622035, index: 97, temperature: -0.1, humanTs: "2020-07-18 09:40:22"},
{timestamp: 1595091718261, index: 98, temperature: -0, humanTs: "2020-07-18 13:01:58"},
{timestamp: 1595103814487, index: 99, temperature: 0.1, humanTs: "2020-07-18 16:23:34"}]

Comments

  • edited July 30

    Hello @re_404,

    I'd like the x-axis of my Webix chart to be labeled in human-readable dates.

    It is possible to modify the visual representation of the incoming data by setting a custom template of a certain axis. In your case, it could look something like https://snippet.webix.com/qo12zw2h. The timestamp is converted to a Date object, which is then converted to a readable string that we can use as our template.

  • Thanks very much!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion