I need to create a nice looking histogram using a json response from my back-end service.
I have looked into some freely available charting api, but none I found has option to create histogram.
Before I embark on daring and laborious task of create a histogram from scratch using jquery/css, I want to check here if someone already know solution to my problem.
BTW, I am familiar with Google's charting api and used it before. But, that too didn't have histogram option.
My example of service response json looks like this:
{
"hist_values":[
{
"start_value":"0",
"end_value":"0.1",
"count":624202
},
{
"start_value":"0.1",
"end_value":"0.2",
"count":80706
},
{
"start_value":"0.2",
"end_value":"0.3",
"count":48601
},
{
"start_value":"0.3",
"end_value":"0.4",
"count":14064
},
{
"start_value":"0.4",
"end_value":"0.5",
"count":1619
},
{
"start_value":"0.5",
"end_value":"0.6",
"count":1255
}
]
}
There are some other similar question/answers on stackoverflow.com, since none of them answered my question satisfactorily, so I am posting a new one.
After a quick Google, I found an example of a Histogram on jsfiddle.
Unsure who wrote this originally, but with some tweaking you could change the code to work with your data, or you could re-format your data to closer resemble the example data set.
It works with jQuery and the Highcharts library (which can be used for personal / non-profit for free under the Creative Commons Attribution-NonCommercial 3.0 License - http://shop.highsoft.com/highcharts.html)
http://jsfiddle.net/jlbriggs/9LGVA/