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

Merged
merged 3 commits into from
Jan 10, 2025

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.

@bwajtr bwajtr enabled auto-merge (squash) January 10, 2025 07:41
@bwajtr bwajtr merged commit 19d7525 into main Jan 10, 2025
5 checks passed
@bwajtr bwajtr deleted the fix/4731-allow-any-plot-options branch January 10, 2025 07:54
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.7.0.alpha4 and is also targeting the upcoming stable 24.7.0 version.

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

Successfully merging this pull request may close these issues.

3 participants