I'm using highcharts-ng with highcharts.js
Everytime i launch the graph i get this error:
angular.js:13920 TypeError: Cannot read property 'pos' of undefined
at https://code.highcharts.com/stock/highstock.js:518:422
at Array.forEach (<anonymous>)
at a.each (https://code.highcharts.com/stock/highstock.js:27:466)
at F.<anonymous> (https://code.highcharts.com/stock/highstock.js:518:396)
at F.a.(anonymous function) [as getPlotLinePath] (https://code.highcharts.com/stock/highstock.js:19:437)
at a.Tick.renderGridLine (https://code.highcharts.com/stock/highstock.js:113:264)
at a.Tick.render (https://code.highcharts.com/stock/highstock.js:115:472)
at F.renderTick (https://code.highcharts.com/stock/highstock.js:159:427)
at https://code.highcharts.com/stock/highstock.js:160:448
at Array.forEach (<anonymous>)
Any ideas?
Hi @Lir10
Could you contact with our support? See: https://www.highcharts.com/support
We use github issues for bug reports. In your case I am not sure if this is a bug in Highstock, misconfigured chart or a bug in highcharts-ng module.
Any ideas?
Only one idea: error suggests xAxis/yAxis ticks issue, so I would try to remove options defined there and see if this resolves the issue. If yes, then please recreate issue in jsfiddle, without highcharts-ng to be sure it's a bug in Highstock lib.
Hi @pawelfus ,
You were right - the problem was on the xAxis ticks
Closing the issue
@Lir10 May I ask what the problem was? I have the same issue and am trying to pinpoint the cause. Thanks!
@bobheadxi
I would suggest to do this:
Any ideas?
Only one idea: error suggests xAxis/yAxis ticks issue, so I would try to remove options defined there and see if this resolves the issue. If yes, then please recreate issue in jsfiddle, without highcharts-ng to be sure it's a bug in Highstock lib.
@Lir10, could you please describe where exactly was the problem, if you still remember? I'm facing the same issue, but I can't catch the circumstances, it just happens randomly, and unfortunately @pawelfus 's answer doesn't help pretty much.
Hi @davletovalmir
If you will be able to provide a stable way to recreate the issue please share a link for the demo or files needed.
@KacperMadej, I couldn't find the root cause yet, but here is what I've found out (I'm sorry in advance for a pieces of obfuscated code below):
step
function, inside that block:d.group.animate({
scaleY: 1
}, G(z(d.options.animation), {
step: function(a, b) {
h[f] = v + b.pos * (c.pos - v); /// <-- b is undefined
d.group.attr(h)
}
}))
step
function is called here, as you can notice, with context, but without a
and b
args:animate: function(e, q, b) {
q = a.animObject(y(q, this.renderer.globalAnimation, !0));
y(m.hidden, m.msHidden, m.webkitHidden, !1) && (q.duration = 0);
0 !== q.duration ? (b && (q.complete = b),
h(this, e, q)) : (this.attr(e, null, b),
q.step && q.step.call(this)); /// <-- function called without arguments
return this
}
animate
function is part of SVGElement
and was called inside render
function.I didn't have enough time to inspect that issue in depth. Hope what I've found will be helpful for you.
P.S. Also attaching piece of screenshot with console error. Not sure if it will help a lot, but who knows :)
@davletovalmir
Thank you for the info - it's enough for me to recreate the problem.
Here's a workaround with code fix:
https://jsfiddle.net/BlackLabel/L6x08jeq/1/
You could apply the code fix from the demo into your code (like a module - after main Highcharts file). If you have time please check if this resolves the error in your app.
FYI: Not minified, human readable code for Highcharts related files is available by using files with .src.js
- e.g. highcharts.src.js
.
when chart is rendered for a first time, and mainly when focus is not on the browser
That's something to check - this might be connected to a recent feature that prevents animation for unfocused browser cards / windows (because there's no need to animate when no one is watching).
I was able to get the correct corresponding code in not minified code. The key here is to use column series type.
Demo: https://jsfiddle.net/BlackLabel/L6x08jeq/
Steps:
_Internal note:_
H.pick((fx && fx.pos), 1)
instead of fx.pos
seems to be resolving the problem, but testing is required to confirm.
@KacperMadej, thanks, that makes sense. Fix works :)
Could you please estimate when this fix will be released?
@davletovalmir
The fix will be in PR this week and should be released with next Highcharts version.
In the meantime:
The issue was caused by the animate
function not passing appropriate arguments to step
when it bypassed animation, so I fixed it there instead.
@KacperMadej how long until the next release? We just migrated from angular highcharts and would love to just install the version with the fix before merging our feature branch, instead of starting out with additional code to fix a bug, that won't be there anymore in a few days.
Next version (7.0.3) is scheduled by the end of this week
Is there an updated ETA?
Regression tests are in progress. Once all of the issues are resolved, new version will be released - I would expect new release soon, a few days max.
It's released now @yhoiseth
Sweet! Thanks for letting me know 🙂
For some reason, GitHub didn't notify me, even though I'm "watching releases" for this repository 🤔
I don't know why you didn't get the notification, but still, you can sign up to our mailing list: https://www.highcharts.com/blog/download/
Most helpful comment
Next version (7.0.3) is scheduled by the end of this week