Dynamic histogram charts
I would love to see interactive histogram charts. Ideally I would pass a single series of data to the chart, along with a default number of bins. Then the user would be able to change the number of bins and the data would be re-binned and the chart re-drawn. Bin labels would be need to be regenerated automatically as well, either from the range of each bin, or its center-point.
An example:
Series: { data: [1,2,1,2,1,2,3,3,4,4,4,4,4] }
Histogram: { defaultBins: 2}
would become:
xAxis: { Categories: [ "1-2", "3-4"] }
Series: { Date: [6, 7]}
Then if the user changed number of bins to 4 (via a slider or text entry), the data would be rebinned as:
xAxis: { Categories: [ "1", "2", "3", "4"] }
Series: { Date: [3,3,2,5]}
and the chart redrawn.
This feature would be especially useful in scientific applications, where histograms are frequently used.
See our official histogram demo at http://www.highcharts.com/demo/combo-histogram
-
Jamie commented
@Larry - do you mean having the histogram rotated horizontally?
If so, take a look at this SO answer and demo:
-
Larry commented
Will we be able to plot histogram on y axis. For high stock? I'm looking for a volume profile chart. And histogram on y axis comes close.
-
Jamie commented
Updated example of a histogram with Highcharts: http://jsfiddle.net/jlbriggs/gud4bp66/
- http://www.highcharts.com/blog/213-histogram-when-why-how
- http://www.highcharts.com/blog/214-histogram-when-why-how-part2 -
Thanks Ivan, would you consider adding it to our Plugin registry? www.highcharts.com/plugin-registry/
-
Ivan commented
-
luke commented
Is there a way from within HighStock to determine what the bin size is when clicking on a histogram datapoint? For a time-based histogram, i'd like to know the start and end time of each bin programatically.
-
@Dominik Currently not, but you might be able to get the required result by using an area chart and step:true.
-
Dominik commented
one can make simple histograms with barcharts. as soon as the bucket sizes are not equal you are screwed though :( or is there a way to individually set the width of each bar?
-
Michael Young commented
"Date" in the example above should be "data".
-
Jamie commented
I make histograms with Highcharts frequently: http://jsfiddle.net/jlbriggs/9LGVA/3/
But you have to pre-process your data. -
Would a tightly packed column chart do? http://jsfiddle.net/WbHsX/
-
Mark commented
The charts you have are good, but one thing I have a hard time finding is support for histograms. These are really valuable charts for evaluating some types of data where the really important trends don't show up in typical time-series graphs.