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

fix: allow to set any type of PlotOptions to Navigator.series #6996

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bwajtr
Copy link
Contributor

@bwajtr bwajtr commented Jan 3, 2025

Description

The Navigator class allows setting additional plot options in the navigator.series attribute → the navigator uses it to configure the small charts that is visible under the main chart.

image

According to the API spec, you should be able to set any PlotOptions type to the navigator.series attribute (any subclass of AbstractPlotOptions).

image

However, in the Vaadin Chart Java API, the navigator.series attribute was defined as PlotOptionsSeries - which itself is a subclass of AbstractPlotOptions. During the implementation of Gantt chart support in I faced the issue, that this is not enough, and you can't configure the Navigator as you want this way. For example, you can't use the PlotOptionsGantt as navigator.series because PlotOptionsGantt is not a subclass of PlotOptionsSeries — in fact, none of the PlotOptions*** classes is.

So you cannot do for example the following:

        final PlotOptionsGantt navigatorPlotOptions = new PlotOptionsGantt();
        navigatorPlotOptions.setPointPadding(0.2);
        navigator.setSeries(navigatorPlotOptions);

This change changes the type of the navigator.series attribute to AbstractPlotOptions, so you can set there any plot options and therefore configure the navigator properly.

This change is backwards compatible.

Part of #4731

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.
  • I have not completed some of the steps above and my pull request can be closed immediately.

Copy link

sonarqubecloud bot commented Jan 8, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant