blacklabel / annotations

Annotations plugin for Highstock by Black Label
http://blacklabel.github.io/annotations/
Other
22 stars 16 forks source link

Fix for rect fill #64

Closed eltonjude closed 7 years ago

eltonjude commented 7 years ago

Without fix: http://jsfiddle.net/hg902ra2/5/ With fix: http://jsfiddle.net/hg902ra2/6/

Also fixes the readme to correct supported shape type from square to rect

pawelfus commented 7 years ago

Thank you!

eltonjude commented 7 years ago

The co-ordinate of circle gets messed up sightly.

Before: [image: Inline image 2]

After: [image: Inline image 1]

Where: annotations: [{ xValue: 3, yValue: 150, shape: { type: 'rect', params: { r: 2, width: 36, height: 2, fill: '#000' } } },{ xValue: 2, yValue: 350, shape: { type: 'circle', params: { r: 20, width: 2, height: 36, fill: '#000' } } }]

On Fri, Oct 21, 2016 at 6:16 AM, Paweł Fus notifications@github.com wrote:

@pawelfus commented on this pull request.

In js/annotations.js https://github.com/blacklabel/annotations/pull/64#pullrequestreview-5232421 :

@@ -515,7 +515,7 @@ }

      if (!shape && shapeOptions && inArray(shapeOptions.type, H.ALLOWED_SHAPES) !== -1) {
  • shape = annotation.shape = renderer[options.shape.type]().attr(shapeOptions.params);
  • shape = annotation.shape = shapeOptions.type === 'rect' ? renderer[options.shape.type]().attr(shapeOptions.params) : rendereroptions.shape.type;

Only rect after all? Maybe rendereroptions.shape.type.attr(shapeOptions.params) then? What do you think?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/blacklabel/annotations/pull/64#pullrequestreview-5232421, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdZr_geUJUNb47UoizkPpMIo6gdB4Abks5q2JD_gaJpZM4KcOP6 .