I'm trying to implement a d3.js histogram on my website which is getting the data from a solr response. On my research I discovered Mike Bostock who's offering great D3 solutions. One of it is the "Histogram II" which would fit perfectly for my needs. The problem is that it (and all other comparable solutions I found) comes with a .csv as data source. I would like to use an array as data source but failed as I tried to change the input.
Can you please give me a tip which lines have to be changed to use the following array, which is currently based on Mike Bostocks .csv:
my_data = [
{"id": "10097071", "case": "HY285524", "date": "06/02/2015 09:41:19 PM"},
{"id": "21907", "case": "HY291065", "date": "06/07/2015 03:50:00 AM"}
]
Thanks in advance.
parseDatevariable simply defines the specifier. In Bostock's code, the dates are being parsed in the accessor (row) function. However, there is no accessor function if you're using a variable to store the data. That being said, you have to use aforEachor something similar.