Plot X Axis Graph with Date

Asked

Viewed 52 times

0

Galley,

I have a chart and I would like to put on the X axis the Date

It was like this:

xAxis: {
    tickColor: 'transparent',
    tickDecimals: 2
},

I put it like this:

renderer: $.jqplot.DateAxisRenderer,
tickOptions:{formatString:'%Y-%m-%d'}

But he does not form, appears like this: inserir a descrição da imagem aqui

My PHP has the following return:

{"visits":[[1496372400,"4435"],[1496631600,"4446"],[1496804400,"4462"],[1497236400,"4508"]],"returning_visitors":[[1496372400,"29222"],[1496631600,"29496"],[1496804400,"29733"],[1497236400,"30232"]],"extra":[[1496372400,"33657"],[1496631600,"33942"],[1496804400,"34195"],[1497236400,"34740"]]}

1 answer

0

try using the date command in PHP. Ex.:

date('Y/m/d', $variavel_data);
  • This response was flagged as low quality due to size or content. Please, if possible and if this is a solution to the problem, explain better how you solved it. The code may be trivial to you, but to other users it may not be.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.