Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Add more interfaces so restrictions are more clear -> more typesafe #5

@Joelius300

Description

@Joelius300

The idea is to make everything a bit more typesafe. Currently you can plug in any Type for TData in ChartConfigBase which allows basically anything to be the Data which will be serialized. This isn't a big problem because it's not exposed to the user of the library (unless they implement a new chart).
However currently the Data for bar- and linecharts use the same interface for their Datasets. This means that you could use a dataset for a barchart in a linechart. This should only allowed in a mixed chart. For this reason it would be good to have more abstractions. Think something like this:

  • IDataset <- covarient, defines the IReadOnlyCollection and the ChartType
  • IMixableDataset <- implements IDataset
  • ILineDataset <- implements IMixableDataset
  • IBarDataset <- implements IMixableDataset
  • IBubbleDataset <- implements IDataset<BubblePoint>
  • DoughnutDataset <- implements IDataset

For this solution it might also be a good idea to have something like INumber which is implemented by all number wrappers. You could also just make all the numbers to floats because you can still store a 2 in a float.

There might be a better solution for this but this is one of the floating ideas I had about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions