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

Add SeriesBase.convert_to() method to convert between series types. #107

Closed
hcpchris opened this issue Sep 19, 2023 · 0 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@hcpchris
Copy link
Collaborator

hcpchris commented Sep 19, 2023

It would be useful to add a .convert_to(series_type) method to the SeriesBase class. This method would convert from one series instance to a second series instance.

For the sake of simplicity, the strategy to adopt should be:

  1. Serialize the originating instance to JS literal.
  2. De-serialize the targeted series type from JS literal.

IMPORTANT: This will be a lossy-operation for certain conversions. The reason for that is because not all series have the same underlying data structures, and not all series have the same properties. It is unrealistic to validate / warn when there is a data loss occurring within the conversion - users should know what they are doing.

Furthermore, in certain circumstances an error may get thrown which will require the addition of a special error (HighchartsSeriesConversionError).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant