Skip to content

Series points error #17991

Closed
Closed

Description

@KamilKubik

Expected behaviour

After adding a new series with visible: false property, setting a color.patternIndex property on another series, and viewing it in the full screen, I should be able to exit the full screen by clicking it in the menu.

Actual behaviour

After adding a new series with visible: false property, setting a color.patternIndex property on another series, viewing it in the full screen and trying to exit the full screen by clicking it in the menu, the TypeError: undefined is not an object (evaluating 'a.points.forEach') error occures.

Live demo with steps to reproduce

https://jsfiddle.net/BlackLabel/r5kbh7ef/

Steps:

  1. Add a new, hidden series by clicking the 'Add series' button.
  2. Set the pattern moode in menu
  3. Set the full screen in menu
  4. Try to exit the full screen from the menu

Product version

Highcharts v10.3.1

Activity

  1. pawellysy commented on Nov 18, 2022

    @pawellysy
    Contributor

    Hello @KamilKubik, thanks for reporting this issue!
    Simplified demo: https://jsfiddle.net/BlackLabel/r5kbh7ef/1/

    Unfortunately, it is impossible to workaround, since this part of code is added via addEvent.
    Possible fix would involve checking series' visibility here:

    this.series.forEach(function (series: Series): void {
    series.points.forEach(function (point: Point): void {
    const colorOptions = point.options && point.options.color;
    if (
    colorOptions &&
    (colorOptions as PatternFill.PatternObject).pattern
    ) {
    (colorOptions as PatternFill.PatternObject).pattern
    ._width = 'defer';
    (colorOptions as PatternFill.PatternObject).pattern
    ._height = 'defer';
    }
    });
    });

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions