I am currently working on visualizing some data I have. You can view the fiddle here: http://jsfiddle.net/hohenheim/6R7mu/10/
As part of this visualization, I have extracted a small subset of the JSON data that I am trying to represent, named data2
. Here is what it looks like:
data2 = [
{
"startDate":1396263600.0,
"adId":2483231759355,
"endDate":1401101940.0,
"impressions":754831
},
{
"startDate":1393851600.0,
"adId":2750329551133,
"endDate":1404212340.0,
"impressions":3947368
}
];
This data includes date ranges. My objective is to evenly distribute the impressions across all days within each date range and then aggregate the total impressions per day across all ads. Therefore, the final outcome should only consist of 2 attributes: date
and impressions
. Although I have a proposed solution, there seems to be an issue with aggregating the days correctly because the millisecond representations of certain dates are not identical, even though they fall on the same day. This discrepancy impacts the accuracy of my calculations.
If you examine the chart closely, particularly in the central area, you may notice fluctuating values. In reality, each pair of varying values should actually correspond to a single day when combined.
Is there a method to effectively combine two different versions of milliseconds representing dates that essentially refer to the same day?