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

Vector series type - rotationOrigin not working properly. #8690

wchmiel opened this Issue Jul 26, 2018 · 1 comment


None yet
2 participants

wchmiel commented Jul 26, 2018

Expected behaviour

When rotationOrigin is set to 'start' vector should start from the given [x, y] position, when set to 'end' it should end there.

Actual behaviour

'start' and 'end' position of rotationOrigin move vector a little bit from it's center.

Live demo with steps to reproduce

  1. set rotationOrigin to 'start',
  2. set rotationOrigin to 'end'

Product version


Affected browser(s)


Suggested solution

start and end should be multiply by u variable:

  H.seriesTypes.vector.prototype.arrow = function(point) {
    var path,
      fraction = point.length / this.lengthMax,
      u = fraction * this.options.vectorLength / 20,
      o = {
        start: 10 * u,   // should be multiply by u
        center: 0,
        end: -10 * u   // should be multiply by u
      }[this.options.rotationOrigin] || 0;

    path = [
      'M', 0, 7 * u + o, // base of arrow
      'L', -1.5 * u, 7 * u + o,
      0, 10 * u + o,
      1.5 * u, 7 * u + o,
      0, 7 * u + o,
      0, -10 * u + o // top

    return path;

Live demo with suggested solution:


This comment has been minimized.

Show comment
Hide comment

TorsteinHonsi Aug 1, 2018


Thanks for the report and the solution! Fix coming up in a minute.


TorsteinHonsi commented Aug 1, 2018

Thanks for the report and the solution! Fix coming up in a minute.

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