I'm trying to plot calendar-heatmap
from this link.
I searched all over the documenation but i couldn't find any sample file for the data-format
.
Here's a link for documentation but there's no sample file for it.
In the documentation I find this data being imported datas-years.json
. But I don't have any clue on how the format is. Someone please help me on this.
Cal-Heatmap expects data in a JSON object in the following format:
{
"timestamp1": value1,
"timestamp2": value2,
"timestamp3": value3,
...
}
Value can be any number (integer or float).
All timestamp are in seconds. Seconds are 'UTC seconds' (sometimes also called 'epoch seconds' or 'unix seconds') as the number of seconds since at 01-01-1970 00:00:00 for the GMT date/time provided. Here is UTC second calculator.
Today we are around 1.388.000.000 UTC seconds. The sample on the site shows data from year 2000, that is why its UTC seconds are around 946.000.000 as you saw in the JSON file sample.
Good thing is that you can find easily on the internet how to obtain UTC seconds from other time formats, and than you will be able to create a data file that Cal-Heatmap expects. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With