# Graph to represent an average time

I need some statistics to show when a motor is turning on and off.
Imagine a graph, a visual representation showing when that motor is coming on with a second  less important element showing when it went off.

Over a period of time, I should be able to SEE averages showing when that motor was coming on. Lets say we are looking at a month of logging, we should now be able to see that the motor constantly came on mid afternoon last week, randomly the week before but before that, it mostly always came on early afternoons.

I need to show the viewer that average when the motor is coming on over the course of a week, month, months, year, etc.

Prefer to use nvd3 since it's something we are already using.

Attached are examples which are not really working well for many reasons. In one, the viewer thinks the filled in lower area of the bar is representing that the start time was 00:00am to Y axis. Need a better way to represent this. The top of each bar represents the start time. Or, is supposed to but is confusing to the user at the moment.

In the second two examples, one is showing a short period of time while the other is showing 60 days.
Making the bottoms white to try and show the start/end times isn't working well either.

Can't seem to find the right way of representing this data using an NVD3 graph.
2015-12-09_092604.png
2015-12-09_094751.png
2015-12-09_094813.png
Mike McCracken

Do you have a graph (even hand drawn) that shows what you want the report to show?

mlmcc

No, that is the problem, not able to visualize how this could look otherwise, this question would not exist :).
I do show some examples that we've tried.

I sort of see it as dots as follows, without the line but even that doesn't really show averages over time.

Hoping someone who has either seen a good representation or works on these things can give some ideas, examples.
What should the dots represent?  The time the motor started?  The duration it was on?

mlmcc

The requirement is to show what times the motor came on so that over time, we could start seeing a pattern of when it might be coming on most for example.

I don't know that dots would work but it seems that the graph would have some kind of floating line or dots instead of bars as shown in the examples that we've tried.
greetings projects, you seem like you have some experience with using and making bar graphs, so I won't go into that.  I looked at your bar graph images, and the first one  _092604 , seems like a good amount of days to display for that display size, about a month, but the solid full height bars are NOT good to communicate a single start time. The second one  _094751 , to me indicated for each day a start and end time, for a SINGLE run-time during that day bar. But for many visual displays, you can have too much info, since the start time is the only valued (important) data to communicate, I feel you should use a single narrow bar - line, at the height position of only the start time for a month or less days. If the time period for display is more than 30 days, and less than 60 days, I'd use TWO Display graphs, like in second wid narrow start only bar, with an equal number of time span days in each.
Looking at your 3rd image  _094813  , did little to show me any time "trends" or averages, as once I try to analyze that many days without a clear way to group various time sections of those days together and apart, all I get is an unproductive headache.  If the time display is for more than 60 days, I would use 7 day average start time green narrow bar (one graph bar for one week time), and in each week bar, also have a red narrow line at top for the latest start time in the week, and a blue narrow line below the green , for the earliest start time. . . I think that would be easy to understand the "trends" of start times weekly, over a long period, up to say 40 weeks long?

I guess you say to use display dots, because you want to show longer periods of time, with narrow bar width, but even if you change image graph 3 long term display, to dots, it may not give a visual "time section" length mental organization help to the viewer. Although you might can place line markers at the bottom o de graph every 7 or 10 day section? Or color a 7-10 day section as a background color to show weeks, together, separated mentally?

Thanks you for such a detailed analysis. I failed to mention that sometimes, the motor might come on once or many times a day and some days, it might never come on, adding to the complication.

I have an idea.

What if the graph (first image shown) represented a 24hr period where the X axis was 00:00am to 23:59pm.
As start times are inserted into the db, we would have a process which checks the start time of the entry and if it is lets say for example 1pm, then this would add another *something* to the X axis at the 1pm mark.

I'm not sure what the Y axis would be but it could be the length of time the motor was on I guess.
Member_2_248744

membership
Create an account to see this answer
Signing up is free. No credit card required.

You got me thinking and I think my last post/idea solves it.

I was thinking about a X axis being a 24hr period of time and perhaps there would be no Y axis, at least at the start.

We might need a new table to keep track of this stat.

The new table has columns of a means of keeping a count of increments, for example, 00:00am, 00:30am, 1:00am, etc.

When a start time is put into the db, say 1:08am for example, we increment the count of the column for 01:00am, rounding off to the nearest column, in this case, 01:00am.

Now image you are looking at the graph, it's brand new, just starting life. That first start time would show in the 1am bar as having a count of one. As more starts occur and as columns are updated, we would start seeing when most of the starts happen.

Once we have a base for the graph, we could look at how to add additional details such as length of time the motor was on and some other details but for now, this could work.

I can see eventually adding a Y axis to maybe show counts or days/week, something along those lines.
I see better what you meant, from that last post. Maybe like -

--22----10----07----14----60----44----50----31----29---  > bar height as number of starts for 7 days
--12----01----02----03----04----05----06----07----08---  > X axis , as the Hour time

that would make it easy to see at what hour period had the most or least starts for a period of time.
Wish I had though of that.