-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
categoryInCategory: Highcharts is not defined #13722
Comments
Hi @shashank1010, Im closing the ticket as duplicate of #13710 |
@sebastianbochan The issue still exists in the above usecase. @raf18seb Request you to follow this if you can. |
@shashank1010 we are aware of it, it is already being fixing. This is a duplicate of #13710, please subscribe and follow in there so we can keep all the comments in one ticket. |
@shashank1010 A fix is now on the way. In the mean time, here is a workaround if you prefer not to use 8.1.0: // Workaround for https://github.com/highcharts/highcharts/issues/13722
(function(H) {
H.seriesTypes.column.prototype.adjustForMissingColumns = function(
x,
pointWidth,
point,
metrics
) {
var _this = this;
var stacking = this.options.stacking;
if (!point.isNull && metrics.columnCount > 1) {
var indexInCategory_1 = 0;
var totalInCategory_1 = 0;
H.objectEach(this.yAxis.stacking && this.yAxis.stacking.stacks, function(
stack
) {
if (typeof point.x === "number") {
var stackItem = stack[point.x.toString()];
if (stackItem) {
var pointValues = stackItem.points[_this.index],
total = stackItem.total;
if (stacking) {
if (pointValues) {
indexInCategory_1 = totalInCategory_1;
}
if (stackItem.hasValidPoints) {
totalInCategory_1++;
}
} else if (H.isArray(pointValues)) {
indexInCategory_1 = pointValues[1];
totalInCategory_1 = total || 0;
}
}
}
});
var boxWidth = (totalInCategory_1 - 1) * metrics.paddedWidth + pointWidth;
x =
(point.plotX || 0) +
boxWidth / 2 -
pointWidth -
indexInCategory_1 * metrics.paddedWidth;
}
return x;
};
})(Highcharts); |
Expected behaviour
categoryInCategory should work when highcharts is called as a module instead of loading it with a script tag
Actual behaviour
ERROR ReferenceError: Highcharts is not defined
at e.adjustForMissingColumns (highcharts.src.js:37159)
at eval (highcharts.src.js:37260)
at Array.forEach ()
at e.translate (highcharts.src.js:37220)
at eval (highcharts.src.js:26579)
at Array.forEach ()
at C.renderSeries (highcharts.src.js:26578)
at C.render (highcharts.src.js:26685)
at C.firstRender (highcharts.src.js:26891)
at C.eval (highcharts.src.js:25296)
Live demo with steps to reproduce
https://stackblitz.com/edit/highcharts-centerincategory
Product version
8.1.1
Affected browser(s)
All browsers when Highcharts has been added by npm.
using require('highcharts') or import * as Highcharts from 'highcharts'
The text was updated successfully, but these errors were encountered: