Skip to content
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

Overflow of Annotation.shapes outside the plot area #15399

Closed
MrR341-GER opened this issue Mar 24, 2021 · 1 comment · Fixed by #16325
Closed

Overflow of Annotation.shapes outside the plot area #15399

MrR341-GER opened this issue Mar 24, 2021 · 1 comment · Fixed by #16325
Assignees
Labels
Type: Feature Request Used when a new feature is requested either directly or indirectly

Comments

@MrR341-GER
Copy link

Description of the feature

It would be nice if not only label annotations could be outside of the plot area.

Library related to the feature

Highcharts

Proof of Concept/Live example for the feature

image


You can vote for this feature by adding a thumbs-up reaction to this post.

@MrR341-GER MrR341-GER added the Type: Feature Request Used when a new feature is requested either directly or indirectly label Mar 24, 2021
@pawelfus
Copy link
Contributor

pawelfus commented Apr 6, 2021

Hi @MrR341-GER

Thank you for sharing the idea!

Workaround:

Demo: https://jsfiddle.net/BlackLabel/Lg28w6d4/

Plugin:

(function(H) {
  H.addEvent(
    H.Chart,
    'render',
    function() {
      (this.annotations || []).forEach(function(annotation) {
        if (annotation.shapesGroup && !annotation.options.crop) {
          annotation.shapesGroup.clip();
        }
      });
    }
  )
})(Highcharts);

API:

  annotations: [{
    crop: false, // <==== new option to configure cropping shapes, similar to labels
    shapes: [{
      type: 'path',
      points: [{
        x: 4,
        y: 250,
        xAxis: 0,
        yAxis: 0
      }, {
        x: 4,
        y: -50,
        xAxis: 0,
        yAxis: 0
      }]
    }]
  }]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request Used when a new feature is requested either directly or indirectly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants