I have a following SQL query:
select created, sum(count), count(distinct `source_host`) from monitor where external_host='facebook.com' group by created;
Which gives data, that I represent in json:
[
{
"Created": "2017-08-17",
"SourceHostCount": 130,
"Count": 2
},
{
"Created": "2017-08-18",
"SourceHostCount": 76,
"Count": 2
},
{
"Created": "2017-08-19",
"SourceHostCount": 78,
"Count": 2
}
]
But in template I want to have table which looks like that:
| | 2017-08-17 | 2017-08-18 | 2017-08-19 |
|-----------------|------------|------------|------------|
| SourceHostCount | 130 | 76 | 78 |
| Count | 2 | 2 | 2 |
So the columns are needs to be a values from Created field and rows are the other fields. Is there any way how I can do it by using jQuery Datable?