Answer the question
In order to leave comments, you need to log in
How to determine if an array is trending up or down?
There is an array of time data (for example, website traffic statistics by day). How to analyze this array in php and determine if there is an upward or downward trend (well, or stability)? Those. it is clear that individual elements can stand out from the overall picture - there may be surges and dips that do not change the overall picture. When looking at the chart, a person will immediately determine - how to do it in php?
Tell me in terms of the algorithm, or maybe there are ready-made functions / libraries? The task should be fairly common.
Answer the question
In order to leave comments, you need to log in
1
for d3js, c3js graphs
in php we make curves for each day we display the
most profile comparison in the griffon
2
we can display it in tabular form
We get an array by hours for 1 day
We get an array by hours for the last day We
compare the current hour and the previous one.
Option 3 if you work through the database
We make 1 request for the current hour for today
We make 2 requests for the last day of the current hour
We display a graph or summarize the indicators and compare
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question