Skip to content

Conversation

mhspelt
Copy link
Contributor

@mhspelt mhspelt commented Aug 7, 2024

In the latest version, the base ChartDataset.Data field was changed to object, then derived classes declared it as new List<double?>?. I understand this change was made to support the ScatterChart, but it was giving me problems with inheritance, so I changed it to use generics and avoid the shadowing.

@gvreddy04
Copy link
Contributor

@mhspelt Thank you for the PR. Can you share at least one scenario for an inheritance issue, just for my understanding?

@mhspelt
Copy link
Contributor Author

mhspelt commented Aug 13, 2024

@mhspelt Thank you for the PR. Can you share at least one scenario for an inheritance issue, just for my understanding?

Hi @gvreddy04, here's a very simple example of a code snippet that shows two problems: https://dotnetfiddle.net/1tO4pg

  • Hiding requires casting the ChartDataset to access the data at all
  • Casting the ChartDataset edits the wrong field

Both of these behaviors are, to me as a client of the library, unexpected and are IMHO elegantly fixed by this PR.

[edit]I wrote "dumps 0" in the example, should have been "dumps null"[/edit]

@gvreddy04 gvreddy04 added this to the 3.0.1 milestone Sep 7, 2024
@gvreddy04 gvreddy04 merged commit 386dda9 into vikramlearning:main Sep 7, 2024
2 of 3 checks passed
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.

2 participants