Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Histogram Binning Breaks on Certain Values #10025

Closed
Blitz2145 opened this issue Jan 30, 2019 · 2 comments
Closed

Histogram Binning Breaks on Certain Values #10025

Blitz2145 opened this issue Jan 30, 2019 · 2 comments
Assignees

Comments

@Blitz2145
Copy link

Blitz2145 commented Jan 30, 2019

Expected behaviour

Bins produced regularly.

Actual behaviour

Bins produced are tiny.

Live demo with steps to reproduce

https://codepen.io/anon/pen/jdyEZx

See codepen for repro case, codepen based on docs example, just different data.

Product version

HighCharts v7.0.2

Affected browser(s)

Chrome 71.0.3578.98, and probably all browsers (I suppose)

@sebastianbochan
Copy link
Contributor

Hi @Blitz2145,
Thank you for reporting.

The solution is set pointRange param as 1.

  plotOptions: {
    series: {
      pointRange: 1
    }
  },

Demo:

FYI @Denyllon

@Denyllon
Copy link
Contributor

Denyllon commented Feb 1, 2019

@sebastianbochan Not really. This issue will not be resolved by setting pointRange equal to 1, because that parameter should be set automatically equal to current binWidth value here. Furthermore, this issue is directly related with #9128.

It is possible to workaround it by applying the code below:

(function(H) {
  H.wrap(H.seriesTypes.histogram.prototype, 'derivedData', function(proceed, baseData, binsNumber, binWidth) {
    var data = proceed.apply(this, Array.prototype.slice.call(arguments, 1));
    this.options.pointRange = this.binWidth
    return data
  })
})(Highcharts)

Live example: https://codepen.io/anon/pen/JxWQJJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants