I'm trying to plot the data with DateListPlot function, but having some issues with the output.
Here is what I'm doing. I'm downloading and parsing RAW JSON like this and extracting values section from it:
{
"status": "success",
"data": {
"resultType": "matrix",
"result": [
{
"metric": {
"__name__": "metric_name"
},
"values": [
[
1556901190.699,
"91158"
],
[
1556901220.699,
"91160"
]
]
}
]
}
}
The raw dataset (after JSON processing) looks like below (with the first element for each of three lists below is a UnixTimeStamp):
Inn[1]:= input = {{1.557343390585`*^9, "120587"}, {1.557343420585`*^9,
"120589"}, {1.557343450585`*^9, "120591"}}
Out[1]:= {{1.55734*10^9, "120587"}, {1.55734*10^9, "120589"}, {1.55734*10^9, "120591"}}
Then, dates are being converted to time objects and the entire object converted to the list of lists:
In[115]:= dates = Partition[Map[FromUnixTime, input[[All, 1]]], 1]
And datapoints converted to the list of list as well (for merging in the next phase):
In[116]:= values = Partition[input[[All, 2]], 1]
Out[116]:= {{"120587"}, {"120589"}, {"120591"}}
As the final step, I'm trying to plot the data using DateListPlot:
In[120]:= DateListPlot[Join[dates, values, 2], PlotRange -> All]
But getting the following output:
What am I missing?
Thanks in advance.