KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Display data from a json file in a line chart #1624

Closed NR0Q opened this topic on on Sep 20, 2020 - 2 comments

NR0Q commented on Sep 20, 2020

So I am wanting to take the data from a local json file and display it in a line chart. I found examples of pulling json from other servers or from SQL databases. In my (possibly edge) case I have the json file already on my file system in /html_public/data/myData.json that and I'm thinking I just need to read that into an array for the koolreports line chart to use.

Thanks

NR0Q commented on Sep 20, 2020

btw, here's an except of the source JSON I'm referring to. I have a cron job that 2x an hour updates this file.

{
  "1600633978809":{
    "date":1600633978809,
    "messageCount":2903,
    "currentClients":725,
    "clientSessions":7,
    "highestSessionID":732,
    "uniqueUsers":722,
    "spotters":2,
    "spotsServed":0,
    "sourcePrograms":{
      "App1":731,
      "App2":1
    },
    "errors":{
      "socketError":0,
      "socketLimitMet":0,
      "jsonMessagesLimit":8,
      "spamEvents":0,
      "jsonMessageLimit":0
    }
  },
  "1600635748809":{
    "date":1600635748809,
    "messageCount":4413,
    "currentClients":752,
    "clientSessions":158,
    "highestSessionID":917,
    "uniqueUsers":849,
    "spotters":1,
    "spotsServed":0,
    "sourcePrograms":{
      "App1":713,
      "App2":44
    },
    "errors":{
      "socketError":4,
      "socketLimitMet":0,
      "jsonMessagesLimit":5,
      "spamEvents":0,
      "jsonMessageLimit":0
    }
  },
.....
NR0Q commented on Sep 21, 2020

UPDATE I have the json read in to an array but I think there's some issues with the array and I might have to do some data manipulation to get it so that koolreports likes the data.

Thanks

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

None