Reputation: 193
My use case stems from a problem similar to Generating counts of open tickets over time, given opened and closed dates
I am given a JSON of objects with one or two properties: open date and closed date (if closed). If the task is still open it won't have the property.
My goal is to plot a line chart in Highcharts that shows the count of open tasks over time.
If I were to use a brute force algorithm, I would create a data point for each time interval within the span of time covered by my chart and then determine the count of open tasks for that point, but that sounds really inefficient.
Instead, I could use Highcharts to define the time intervals for the time axis and simply have data points for start, finish and each point where there's a variation in the value (or could I?).
What would be an efficient vanilla javascript code to determine this series and the Highcharts options to plot it? I've seen some sql code arount (including the mentioned article) doing similar calculations, but I find it hard to relate it to my use case.
Upvotes: 0
Views: 83