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
Series.cropData throws error for wind barb series #8713
Comments
For now I "fixed" it by wrapping cropData and passing a bogus yData to it: Highcharts.wrap(Highcharts.Series.prototype, 'cropData', function (proceed, xData, yData, min, max, cropShoulder) {
if (typeof yData === 'undefined') {
yData = {
slice: _.noop
};
let croppedData = proceed.call(this, xData, yData, min, max, cropShoulder);
croppedData.yData = undefined;
return croppedData;
} else {
return proceed.call(this, xData, yData, min, max, cropShoulder);
}
}); |
Hi @luuuke Thank you for reporting the issue and for the workaround! It looks like a bug in our docs, highcharts/js/modules/windbarb.src.js Lines 22 to 24 in 602a253
Of course, this should be fixed, we can exceed default 200 points and this will be broken again: http://jsfiddle.net/BlackLabel/4saL58wu/8/ Internal note:
|
@sophiebremer Will you have a look at why the syntax matters? Propably the easiest fix is just to make sure we use the one syntax that works. |
I'm not sure if I'm understanding you right. So the guess is, that setting cropThreshold explicitly in the series config is causing it and by adjusting the docs it will be fixed? |
Hi @luuuke This will be fixed in the core too. Simply we have two issues here: wrong docs and bug in code. As I said above:
|
Expected behaviour
Wind barb's data gets cropped and later displayed.
Actual behaviour
cropData throws an error as yData is undefined for the wind barb series type.
Catching the case of yData being undefined and returning an undefined value for yData makes everything work again.
Live demo with steps to reproduce
http://jsfiddle.net/4saL58wu/2/
Notice how the xAxis' min is later than the series' pointStart. Also cropThreshold is set to 0 for the series to always crop its data. If setting the min to the same value as pointStart or cropThreshold to a higher value, the error does not occur, as cropData is not called.
Product version
Highcharts, Highstock v6.1.1
The text was updated successfully, but these errors were encountered: