ecomfe / echarts-stat

Statistics tool for Apache ECharts
588 stars 309 forks source link

Expose options for bin width and bin count in histogram function #43

Open hughess opened 2 years ago

hughess commented 2 years ago

The methods available in the histogram function work for many cases, but not all. It would be helpful to be able to pass in a bin width or bin count to override the result of the bin calc function:

ecStat.histogram(data, binWidth=50)
// OR
ecStat.histogram(data, binCount=10)
// OR
ecStat.histogram(data, method='freedmanDiaconis')

This would allow a lot more flexibility in how to use the histogram function (e.g., you could add a slider component to a histogram chart to let a user play around with the bin count or width on a page).