No announcement yet.

Creating graphs and histograms - Best way

  • Filter
  • Time
  • Show
Clear All
new posts

    Creating graphs and histograms - Best way

    Hi all!

    Well, I'm planning to create some kind of histograms (bar graphs) in order to represent the electricity consumption, temperature evolution, etc. I suppose I should follow the following main steps:

    1 - Create databases
    2 - Fill the databases in real time from the recollected data (HS variables).
    3 - Periodically, create graphs from the databases and convert them into jpg or gif images.
    4 - Load these images in my web pages.

    Is this supposition right?

    Bearing in mind these steps,

    1- Wich database format do you prefer for this short of application? SQL or MS Access? Would you store data directly in a MS Excel sheet? I don't need to store important amounts of data.
    2 - Is there a plug-in or script that stores automatically variables in a database or table? I've heard about UltraLog but I think it logs all events. Do you recommend me to access the databases directly from my own HS script?
    3- For the graph generation, I know there is an script called "Xlgraph". If not, should I call Excel functions from my HS scripts? Should I create a script in MS Excel in order to create periodically every histogram?
    4- Am I right loading graphs as images into my web pages?

    I'm very interested in knowing your thoughts about this subject.

    Thanks again,


    I'm using this component for my charting:
    It's free and you can generate graphs and pies on the fly using .Net Framework.

    Say you want to make a monthly chart, the first one to request the chart generates it and you save it to disk, so that the next hit pulls up the saved one to save resources.



      Thanks Morten but... I know NOTHING about .NET and diving into a new world scares me. Anyway it appears as a very good solution.

      Thank you very much.



        With HS moving to .Net this might be a good place to jump right in :-)


          mcsTemperature plugin does most of what you want on the back end side with data collection and interaction with Homeseer, but its front-side orientation is toward line trend charts rather than bar charts. Bar charts are easily made with simple HTML. I believe there is a post in the last few weeks with this HTML code in the thread that is discussing whole house energy monitoring.

          There is not right or wrong or best. It all depends on the individual situation. If you want to use Excel, then XLGraph just makes it easier if you are starting from a script/asp page to drive it. It also contains the jpg generation function out of Excel that is not widely known.

          If you want to get fancier and have interaction with the user's mouse then you can do your graphics on the client side with javascript. There are other charting objects in the cost range of free to to-much. I think something like MRTG is free and is oriented to browser presentation.


            Morten, indeed I'll have to dive into that new world some day... shortly.

            Michael, I thought that MCSTemperature worked only with 1-Wire interfaces and my input data will come from a RS232 port. Anyway, I'd like to create different chart types other than line trends. Nvertheless, I'll consider this possibility.

            I prefer to work on the server side (scripting and asp) because I'd like represent the graphs in MainLobby too. So, Xlgraph could solve my problem too. With this option, I need to manage a database from the VBScript interface. Since I've never done that, does anyone know a tutorial/document/message that explains how to read and write a MS Access database from VBS?

            Thank you very much.