Skip to content

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

@hcpchris

Description

@hcpchris

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).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions